web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Make An Event Handler To Change Data Inside The Field In The Table Before update() Or Insert() Method

(0) ShareShare
ReportReport
Posted on by 202

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 :

8233.1.JPG

2844.2.JPG

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

I have the same question (0)
  • Mea_ Profile Picture
    60,286 on at

    Hi Chaidir Ali Assegaf,

    To update a table buffer it should be selected for update that is a correct behavior, so could you please explain why you cannot update it?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans