Call methods on 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(); }
static void main(Args args)
{
THK_InterfaceDataExtract THK_InterfaceDataExtract;
FormRun formRun = args.caller();
object callerForm = args.caller();
;
THK_InterfaceDataExtract = THK_InterfaceDataExtract::construct();
if (THK_InterfaceDataExtract.prompt())
THK_InterfaceDataExtract.run();
if (formHasMethod(formRun,identifierstr(refreshData)))
callerForm.refreshData();
} // AX2012 if (caller is FormRun && formHasMethod(caller, identifierStr(someMethodOnTheForm))) { caller.someMethodOnTheForm();
}
Example:
static void WL_YZF_ClassTransferItemMenuItem(Args _args)
{
SalesTable salesTable;
Args args;
FormRun myFormRun;
MenuFunction mf;
SalesFormLetter_Invoice SalesFormLetter_Invoice;
;
select firstonly salesTable
where salesTable.SalesId == "00002173_C05";
args = new Args(ClassStr(SalesFormLetter));
args.record(salesTable);
mf = new menuFunction(identifierstr(SalesFormLetter_Invoice),MenuItemType::Action);
mf.run(args);
}

Guess you like

Origin www.cnblogs.com/xtwkh1973/p/10992868.html