Friday, October 11, 2024

D365 F&O form refresh after pressing button using event handler

 [FormControlEventHandler(formControlStr(SalesTable, Button), FormControlEventType::Clicked)]

public static void Button_OnClicked(FormControl sender, FormControlEventArgs e)

{

       #Task

    FormDataSource  salesTable_ds = sender.formRun().dataSource(formDataSourceStr(SalesTable, SalesTable));        

    SalesTable salesTable = salesTable_ds.cursor();

           

    sender.formRun().dataSource(formDataSourceStr(SalesTable, SalesTable)).refreshEx();

    salesTable_ds.refresh();

    salesTable_ds.research(true);

    sender.formRun().task(#taskF5);

}

No comments:

Post a Comment