I am having issues with querying UtilElements and UtilIdElements in Dynamics AX 2009.
Screenshot #1 shows the class SalesFormLetter being present in the layers sys
, syp
, gls
, glp
and cup
. However, when I run the following the code the output displays that the object exists only in the sys
layer. Output of this code is given in screenshot #2.
Am I doing something wrong in this code? I would like to know all the layers in which a given object is present.
Thanks in advance.
#AOT
UtilElements utilElements;
UtilIdElements utilIdElements;
;
info('Querying UtilElements...');
while
select utilElements
where utilElements.name == 'SalesFormLetter'
&& utilElements.recordType == UtilElementType::Class
{
info('Layer: ' + enum2str(utilElements.utilLevel) +
', Object type: ' + enum2str(utilElements.recordType));
}
info('Querying UtilIdElements...');
while
select utilIdElements
where utilIdElements.name == 'SalesFormLetter'
&& utilIdElements.recordType == UtilElementType::Class
{
info('Layer: ' + enum2str(utilIdElements.utilLevel) +
', Object type: ' + enum2str(utilIdElements.recordType));
}
Screenshot #1:
Screenshot #2: