D365 get form Datasource and selected record buffer Event handler
[FormDataSourceEventHandler(formDataSourceStr(Salestable, SalesTableDS), FormDataSourceEventType::Written)]
public static void SalesTableDS_OnWritten(FormDataSource sender, FormDataSourceEventArgs e){
FormRun formRun = sender.formRun() as FormRun;
// you can call form methods here
formRun.callMethod();
// Get the selected datasource record from the grid
TableName tableBuffer = sender.cursor();
// Get datasource variable
FormDataSource dsVariable = sender.formRun().dataSource(“TableName”);
}
No comments:
Post a Comment