Home > X++ stuffs > Classes “RunOn: Server” in Dynamics AX

Classes “RunOn: Server” in Dynamics AX

 

Here is the sample job which gives the details list of classes called on "Server".

 

static void Classes_CalledOnServer(Args _args)

{

    #AOT

    TreeNode treeNode;

    str property = ‘RunOn‘;          [Property Name in Property Sheet]

    str propertyValue = ‘Server‘; [Property Value]

    ;

 

    treeNode = TreeNode::findNode(#ClassesPath).AOTfirstChild();

    while (treeNode != null)

    {

        if (treeNode.AOTgetProperty(property)== propertyValue)

        {

            // Displays the output into Message Window.

            //Debug::printTab(DebugPrintTab::ActiveX, treeNode.AOTname()); This is unable to list all classes. So replace with below

          info(treeNode.AOTName());

        }

 

        treeNode = treeNode.AOTnextSibling();

    }

}

Advertisements
Categories: X++ stuffs
  1. Santosh.
    December 11, 2008 at 9:52 am

    A small change is made to the job. Instead of using// Debug::printTab(DebugPrintTab::ActiveX, treeNode.AOTname()); –> This doesn\’t return all the classes.So change it to info(treeNode.AOTname());Thanks Anitha[:)] for updating me on the same.

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: