Hi,
i have question about clicked method like this.
for example : in form WHSLoadPlanningWorkbench for button ValidateLoad, i can see method clicked like this:
void clicked()
{
loadPlanningWorkbenchForm.validateLoad_clicked(whsLoadTable_ds);
super();
}
i want to add condition for this button like this :
void clicked()
{
if(whsLoadTable.DSI_Flag == NoYes::Yes)
{
error("Error");
}
else
{
loadPlanningWorkbenchForm.validateLoad_clicked(whsLoadTable_ds);
}
super();
}
i can use this condition in AX2012.
But, how to create this methods in D365FO.
i try to create extension and copy event handler like this :
[FormControlEventHandler(formControlStr(WHSLoadPlanningWorkbench, ValidateLoad), FormControlEventType::Clicked)]
public static void ValidateLoad_OnClicked(FormControl sender, FormControlEventArgs e)
{
Args args = new Args();
FormButtonControl callerButton = sender as FormButtonControl;
FormRun form = callerButton.formRun();
FormDataSource whsLoadTable_ds = form.dataSource(formDataSourceStr(WHSLoadPlanningWorkbench, WHSLoadTable)) as FormDataSource;
WHSLoadTable whsLoadTable = whsLoadTable_ds.cursor();
if(whsLoadTable.DSI_Flag == NoYes::Yes)
{
error("Error");
}
}
But, i get 2 message :
i want, if flag 'Yes', just show info 'Error'.
please help me.
Thanks.

Report
All responses (
Answers (