Hello everyone,
I am working with forms and menu item buttons and I have an issue with menu item buttons.
I want to ask is there a way to get form control if we only have form name and menu item name of that control?
I used this:
Form form = new Form('PurchTableListPage');
FormFunctionButtonControl formControl;
str txt;
;
formControl = form.design().control(menuitemDisplayStr('LedgerTransVoucher1'));
if (formControl)
{
txt = formControl.name();
info(Txt);
}
But i dont have the name so it isn't worked.
Any ideas?
Thank you.
*This post is locked for comments
I have the same question (0)Menu item name does not make any sense.
You need to know the form control by its' AOT name. If you have that, you could do
form.formRun().control(form.formRun().controlid('YourControlNameInAOT'));
Take a look at this as well:
http://stackoverflow.com/questions/6937986/how-to-get-the-form-object-in-a-listpageinteraction-class
If you do not know the form control's name like FormTabControl, then you could just iterate all form controls (see an example in SysWizard.prompt() method), and check the type of the formcontrol against their control types with the "is" keyword.