D365 Finance and Operations: How to get the value datasource of form in an Event handler in Dynamics 365 Finance & Operations X++ method SalesEditLines_Post_closeOk
In this example I'll be showing you how to get a data-source in the event-handler for form method 'closeok'. In this example I'm using post event.
You can change the code for other form methods in the same way.
class SalesEditLines_EventHandler
{
[PostHandlerFor(formStr(SalesEditLines), formMethodStr(SalesEditLines, closeOk))]
public static void SalesEditLines_Post_closeOk(XppPrePostArgs args)
{
FormRun sender = args.getThis();
SalesParmUpdate salesParmUpdate;
salesParmUpdate = sender.dataSource(formdatasourcestr(SalesEditLines, SalesParmUpdate)).cursor();
info(salesParmUpdate.ParmId);
}
}
No comments:
Post a Comment