O'Reilly logo

Learning MS Dynamics AX 2012 Programming by Erlend Dalen, Mohammed Rasheed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Direct handling

In many tables in AX, the insert, update, and delete methods have been overridden to include checks or other form of logic. As you can see in the overridden insert method here, you can put code before or after the super() call if you need something to happen before or after the record has been inserted into the record buffer:

public void insert()
{
    // Put code to happen before inserting 
    // the record here
    super(); // The INSERT INTO statement in SQL is executed
    // Put code to happen after the record
    // has been inserted here
}

In some cases though, you will need to be able to insert, update, or delete a record in the table without running the code inside the method. You could then override the method as shown in the preceding code, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required