I want to recall a value of an edit
method declared inside a form from a class main. How can I do it?
[Form]
public class AdvancedCustomerSchedule extends FormRun
{
Sorting sorting;
edit Sorting edtSorting(boolean set, Sorting _sorting)
{
if (set)
{
sorting = _sorting;
}
return sorting;
}
}
and the class:
class AdvancedCustomerScheduleService
{
static void main(Args args)
{
//I want to call the method edtSorting here.
}
}
UPDATE
FormRun callerForm;
if (args.caller() is FormRun)
{
callerForm = args.caller() as FormRun;
if (formHasMethod(callerForm, identifierStr(edtSorting)))
{
str test = callerForm.edtSorting();
info(test);
}
}
For calling methods defined on forms in general you usually use a pattern like the following:
Have a look at class
DirPartyContactInfoFormHandler
and its staticmain
method for an example.