I have made a display method and used it in a field in salesTable form, in formcontrolgroup. The display method has some calculation and returns grossWeight type. I want to check if else in a event handler on FormControlStr and display a warning if that condtion is violated. The warning will trigger when i click on All sales order>sell ( action pane) > Generate > confirm sales order.
I want to use that display method in event handler.
public final class SalesTable_EventHandler
{
[FormControlEventHandler(formControlStr(SalesTable, buttonUpdateConfirmation), FormControlEventType::Clicked)]
public static void buttonUpdateConfirmation_OnClicked(FormControl sender, FormControlEventArgs e)
{
Args args = new Args();
FormCommandButtonControl callerButton = sender as FormCommandButtonControl;
FormRun form = callerButton.formRun();
FormDataSource salesTable_ds = form.dataSource(formDataSourceStr(SalesTable,SalesTable)) as formDataSource;
SalesTable salesTable = salesTable_ds.cursor();
CustTable custTable = CustTable::find(salesTable.CustAccount);
if( SalesTable::totalWeight(salesTable) < custTable.MinWeight)
{
warning("Total Gross Weight should be more than Minum weight");
}
}
}
Hi Lucifer,
Display method you have written is in table or form level?
Try calling like below.
salesTable.displayMethodName();
Just type in the method name if Intelli sense didn't show.
Thanks,
Girish S.
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156