Tuesday, 8 January 2019

D365 get current record in form Control Event on button clicked

Get current record in form control event

[FormControlEventHandler(formControlStr(CustomForm, CustomButton), FormControlEventType::Clicked)]
public static void CustomButton_OnClicked(FormControl sender, FormControlEventArgs e)
{
// ds number 1 is for the first datasource
CustomTable callerRec = sender.formRun().dataSource(1).cursor();
}

thanks

No comments:

Post a Comment

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...