I want to call a menu item button of the form, from my class.
In a class follow below procedure
// MyFormControllerClass classDeclaration
public class MyFormControllerClass
{
FormFunctionButtonControl formButton;
}
public FormFunctionButtonControl parmFormButton(FormFunctionButtonControl _formButton = formButton)
{
formButton = _formButton;
return formButton;
}
protected void someEventHandler()
{
if (formButton)
{
formButton.clicked();
}
}
To call above class in form init method
public class FormRun extends ObjectRun
{
MyFormControllerClass formController;
}
// form init
public void init()
{
super();
formController = new MyFormControllerClass();
// pass the button reference
formController.parmFormButton(MyFormButtonWithAutoDeclarationYes);
}
Ex: see the class -> LedgerJournalFormTable.
scenario:: In LedgerJournalTable form i want to disable the post button for perticular user group persons.
Go to LedgerJournalFormTable class in enableButtonsActive method write following code.
while select userGroupList
where userGroupList.groupId == "Post Group"
&& userGroupList.userId == curUserId()
{
ctrlPostJournalMenu.enabled(false);
}
No comments:
Post a Comment