
I want to override the standard behaviour when I click on CustTable_tutStoreId control of my CustTable Form
First create an extension class of your form and create a new method tutStoreIdJumpRef
[ExtensionOf(formStr(CustTable))]
final class tutCustTable_Form_Extension
{
public void tutStoreIdJumpRef(FormControl _formControl)
{
Args args = new Args();
MenuFunction menuFunction;
RetailStoreTable retailStoreTable;
retailStoreTable = RetailStoreTable::find(_formControl.valueStr());
args.record(retailStoreTable);
menuFunction = new MenuFunction(menuitemdisplaystr(RetailStoreHours),MenuItemType::Display);
menuFunction.run(args);
}
}
Then override Init() method by using registerOverrideMethod()
public void init()
{
FormStringControl formStringControl;
next init();
formStringControl = this.design().controlName(formControlStr(CustTable, CustTable_tutStoreId));
formStringControl.registerOverrideMethod(methodStr(FormStringControl, jumpRef)
, methodStr(tutCustTable_Form_Extension, tutStoreIdJumpRef));
}