web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Calling instance methods through reflection

Fawad Hassan Profile Picture Fawad Hassan 337

Hi-

Following job can execute instance method in a class. I had a scenario where I wanted to test my upgrade scripts and you know for running upgrade script there is a need to run the process that consumes a large amount of time, so I thought following job would be useful for the developers

static void callMethodJob(Args _args)

{

DictClass dictClass = new DictClass(classNum(ReleaseUpdateDB60_Cust));

Object classObj = dictClass.makeObject();

DictMethod dictMethod;

int i;

for (i=1; i < dictClass.objectMethodCnt(); i++)

{

if (Global::strStartsWith(dictClass.objectMethod(i), “update”))

{

dictClass.callObject(dictClass.objectMethod(i), classObj);

}

info(strFmt(“%1, %2, %3″, dictClass.objectMethodCnt(), dictClass.objectMethod(i), dictClass.name()));

}

}



This was originally posted here.

Comments

*This post is locked for comments