Dear Experts,
I'm a developer of dynamics AX 2012 R3.
The goal i want to achieve is to change the data that will be stored in the table when update() or Insert() method executed.
Recently, i make a post event handler that will update a custom field i made inside the PurchTable (Purchase Order) and inside the PurchTableType Class (Purchase Order). but, the table can't be updated because the table buffer i used from the update() method is flagged with forUpdate clause.
here is the Post Event Handler that will activate when update() method in PurchTable Table is called :
public static void afterUpdatePurchaseOrderTable(XppPrePostArgs _args) { Common common = _args.getThis(); VDI_PurchTableCustomGridHandler purchTableGridUpdate; purchTableGridUpdate = VDI_PurchTableCustomGridHandler::newFromTable(common); purchTableGridUpdate.run(); }
and below here is the Post Event Handler that will activate when update() method in PurchTableType class is called :
public static void afterUpdatePurchaseOrderClass(XppPrePostArgs _args) { Object object = _args.getThis(); // select purchTable table buffer from PurchTableTYpe Class
VDI_PurchTableCustomGridHandler purchTableGridUpdate; purchTableGridUpdate = VDI_PurchTableCustomGridHandler::newFromClass(object); purchTableGridUpdate.run(); }
below here is the screenshot taken from the debugging session :
Is there another way that i can try to solve this?
I appreciate any answer, Thanks.
Best Regards,
Chaidir Ali Assegaf
*This post is locked for comments