Saturday, November 20, 2010

Using DictClass

The below code is used to print number of methods in a Class ans even their names.

The same code can be extended to all other objects like DictTable class for tables,
dictEnum class for enums etc...

static void dictClass(Args _args)
{
int noOfMethods,i;
DictClass dictClass = new DictClass(ClassNum(InventMovement));
/// InventMovement is the Class
;

noOfMethods = dictClass.objectMethodCnt();
for(i = 1 ; i <= noOfMethods ; i++)
{
info(strfmt("%1. InvemntMovment - %2",i,dictClass.objectMethod(i)));
}
pause;
}


By using DictClass you can also print the number of Static methods and their names.

static void dictClassStatic(Args _args)
{
int noOfMethods,i;
DictClass dictClass = new DictClass(ClassNum(InventMovement));
;
noOfMethods = dictClass.staticMethodCnt();
for(i = 1 ; i <= noOfMethods ; i++)
{
info(strfmt("%1. InvemntMovment - %2",i,dictClass.staticMethod(i)));
}
pause;
}

1 comment:

  1. i have a project import sales order from excel into axapta
    i have been import successful SalesTable in excel in Sheet1
    but in sheet 2, i can't import.

    help me

    thanks

    ReplyDelete