how to find the layer information.

hi all,

I want to retrieve the layer information of various application objects. Is there any method which can get the layer info, i.e., in which layer the particular application object is residing.

Thanks in advance,

Satya.

Hi Satya,

This can be achieved through many ways. Easiest and quickest would be by switching on application object layer field (under Tools → Options → Development tab) to ‘show all layers’.

Now when you open AOT, you should be able to see changes that were made in all layers.

Regards,

Hi Quote,

Thanks for the reply. I’m actually trying to write a code which extracts all the table information and saves in the excel file. So, I need a code which extracts the layer information. I’m trying to extract it using table.applObjectLayer(); but its not working. Can you help me out with this.

Thanks,

Satya.

Hi Satya,

use a TreeNode object and call applObjectLayer() on it. It returns the highest layer for an object.

An example:

#AOT
TreeNode treeNode = TreeNode::findNode(#TablesPath + '\\' + tableStr(Address))
UtilEntryLevel layer;
;
layer = node.applObjectLayer();

If you need information about all layers, use applObjectLayerMask() (see SysTreeNode::getOriginalTreenode() for an example).

Hi Satya,

A while back I wrote some examples for getting and setting table properties. You can use this job as inspiration. Source code at http://community.dynamics.com/blogs/harish/comments/9615.aspx.

On another note, you can also use ‘UtilIdElements’ table to retrieve objects that were touched in a specific layer. For ex -

while select UtilIdElements
where (UtilIdElements.utilLevel == utilEntryLevel::usr
&& UtilIdElements.recordType == utilElementType::Table)
{

Regards,

Thanks a lot Martin it worked.

Regards,

Satya.

Thanks Harish, info was very much useful.

Regards,

Satya.