get a data-source in the event-handler for form method 'closeok', using post event.
You can change the code for other form methods in the same way.
class SalesEditLines_EventHandler
{
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[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);
}
}
Reference:
https://rahulmsdax.blogspot.com/2019/05/how-to-get-form-datasource-object-in.html
You can change the code for other form methods in the same way.
class SalesEditLines_EventHandler
{
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[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);
}
}
Reference:
https://rahulmsdax.blogspot.com/2019/05/how-to-get-form-datasource-object-in.html
No comments:
Post a Comment