Showing posts with label D365 get form Datasource and selected record buffer Event handler. Show all posts
Showing posts with label D365 get form Datasource and selected record buffer Event handler. Show all posts

Tuesday, 8 January 2019

D365 get form Datasource and selected record buffer Event handler

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”);
}

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++  Introduction In our previous posts, we explored what Copilot can do o...