Calling instance methods through reflection
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.

Like
Report
*This post is locked for comments