AOT Find Form

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Use this form to search for application elements in the Application Object Tree (AOT).

Tabs

Tab

Description

Name & Location

  • Search

    Select the type of node to search. The default is to search methods only.

  • Named

    Type all or part of the name of the object you are searching for. The search will search for objects in the AOT with that name.

  • Containing text

    Type the text that should be contained in the object you are searching for. This is useful if you do not know the object's name, but may be able to find the object by searching for text contained in the object.

    The content of an object is X++ source text for method nodes, and the complete property sheet for all other nodes.

  • Show source code

    Select to display X++ code lines or property contents in the search result list.

  • Look in

    Displays the start location for your search.

  • Use selection

    Use the current selection in the AOT as the point of departure for the search.

    If not selected, specify the path in the Look in field.

Note

The Named and Containing text fields accept the search expression characters listed in the documentation about the match Function.

Date

Use the Date and Modified by fields to narrow down the search.

Type dates as DD-MM-YYYY.

The Date and Modified by fields accept ranges.

Advanced

Use the advanced options to further narrow down your search.

  • Type

    Enter an application object type, for example class, form, or menu.

    The Type field accepts a range of UtilElementType enumerators.

  • Size

    Specify the size, in bytes of the X++ code, to search for.

    The Size field accepts a range of numbers.

  • Layer

    Enter the application object layer to perform the search in, for example sys, or usr.

    The Layer field accepts a range of UtilEntryLevel enumerators.

  • Run on

    Specify where the search object must be executed: Client, Server, or Called from.

Filter

Filter search results by adding X++ code to the Source field.

The code is evaluated for each application element that is found. The code needs to return a Boolean value of true if the element should be included in the search results; otherwise the code should return false.

Do not add a method header. The system automatically adds the following header and passes in these parameter values when the search is run.

boolean FilterMethod(str _treeNodeName,
                    str _treeNodeSource,
                    XRefPath _path,
                    ClassRunMode _runMode)

In the following code example, the TextBuffer::find method searches for the 'select: ' text string starting at a character position returned by the TextBuffer::matchPos method.

TextBuffer textBuffer = new TextBuffer();
textBuffer.setText(_treeNodeSource);
return textBuffer.find('select: ') 
    && textBuffer.find('select: ',textBuffer.matchPos() 
    + textBuffer.matchLen()));

The following code example searches for table methods that return a container by using the SysMethodInfo and TreeNode classes.

    boolean filter = false;
    Types retypes;
    SysMethodInfo sysMethodInfo;
    TreeNode treeNode;
    XInfo xinfo = new XInfo();
    ;
 
    treeNode = new TreeNode();
    treeNode = xinfo.findNode(_path);
    sysmethodInfo = new SysMethodInfo(UtilElementType::TableInstanceMethod, treeNode.applObjectParentHdl(),_treeNodeName);
    retypes = sysMethodInfo.returnType();
    if(retypes == Types::Container)
    {
        filter = true;
        return filter;
    }
 
    return filter;