How to calling methods on a caller AX form

Object caller = _args.caller();//element.args().caller()
boolean isCallForm;
;

// AX2009
isCallForm = SysDictClass::isEqualOrSuperclass(classidget(caller), classnum(FormRun));
if (isCallForm && formHasMethod(caller, identifierStr(someMethodOnTheForm)))
{
    caller.someMethodOnTheForm();
}

// AX2012
if (caller is FormRun && formHasMethod(caller, identifierStr(someMethodOnTheForm)))
{
    caller.someMethodOnTheForm();
}



你可能感兴趣的:(caller,X++,formHasMethod,FormRun)