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)

Understanding Form methods, Datasource methods and Table methods for integrating Ax with other ecommerce application.

(0) ShareShare
ReportReport
Posted on by

Hi,

       I am working in integrating the Dynamics Ax and Ecommerce application (Magento) synchronously by consuming Magento webservices in Dynamics Ax.

       I want to create data in ecommerce application whenever the data has been created in Ax. For example : When ever the "Category" has been created in Ax, My custom code in Ax should call Magento webservices in x++ for sending and creating category in Ecommerce application, vice versa for update.

The actual question is "Where should i put custom code" for calling ecommerce application web services. In Ax for creating a category is in "EcoResCategory" form. There are methods at form level, at each individual datasource in a form and table methods.

Dynamics Ax saves the form data automatically like whenever we go to the next field in a form, It looks like to call ecommerce application service many times which will raise the performance issues.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Anton Venter Profile Picture
    20,672 Super User 2026 Season 1 on at

    Hi, code should be on table level as much as possible. Table methods like insert, update and delete are called by the kernel when records are inserted, updated and deleted in forms and in code. In forms it is possible to override some of these methods but they are not executed when records are created, updated or deleted from code. You can use classes from the table methods. Have a look at the SalesTable, SalesLine tables for examples.

  • Suggested answer
    Jonathan  Halland Profile Picture
    11,310 on at

    Hi.

    I would queue these changes as far as possible and perform them asyncronosly to prevent direct performance hits for the users.

    E.G. Create a batch job that processes all records that have been modified or inserted since a given time. Or on certain events like insert delete etc, add a record to a custom queue table that can be processed by the batch job.

    Take a look at how other integration is performed in applications like CRM etc..

  • Suggested answer
    cpironmo Profile Picture
    2 on at

    I would concur with the point made, but to specifically answer your question it would be a matter of your requirements. If you wanted to run this process the minute a category was created, then this should be placed inside the insert method of the EcoResCategory table.

    If you placed this on the form them the code would only be triggered when a category was created in that form. So there is then the potential for your two systems to not be in sync.

    So with that in mind, taking the asynchronous point away (which is valid however), you would place this code at the table level on the appropriate method, such as insert, delete or update.

  • Community Member Profile Picture
    on at

    Thanks to all,

    The Category form in AX have more than 10 data sources. It looks like i need to put my custom code in the insert, update and delete methods in all these tables (or) make one class and call this in all the places. 

    Am i going right (or) Is there another way to put my custom code in a single place which will do the same.

  • Verified answer
    Sohaib Cheema Profile Picture
    49,664 Super User 2026 Season 1 on at

    One entity has one main table. Although your form may has multiple DataSources. But main root DataSource is 1. In case of Categories main DataSource is EcoResCategory

    You don't have to write your code in each DataSource. You have to code under EcoResCategory DataSource/Table only (if you want to take information for categories only).

    But if you have to take other information also such as Category Hierachies etc, you have to add code on other tables also.

    You may make use of AOSValidateDelete, AOSValidateInsert, AOSValidateUpdate methods on your table. Write you logic directly or call a class by passing parameters, which may handle your data.

  • Community Member Profile Picture
    on at

    Thanks Sohaib,

    If i put my code only in EcoResCategory. In form the user will update only the "description" field, then my custom code won't execute unless i put the code in AOSValidateUpdate method under EcoResCategoryTranslation table.

  • Sohaib Cheema Profile Picture
    49,664 Super User 2026 Season 1 on at

    yeah don't write code at form levels. Write your code on Table level , as said above. because at end data will be saved in Table, either coming by Form or if somebody directly creating a record in table.

  • Sohaib Cheema Profile Picture
    49,664 Super User 2026 Season 1 on at

    Dear chakka,

    Apologies , I forgot to add one more point that is sequence of methods call e.g. if there are two methods on table inset and AOSValidateInsert ; At end insert method will be called, prior to that AOSValidateInsert. So you have to take care of this difference. you should write your code at method which is excuted at end and after super(). This is important to get valid data.

    Similarly between AOSVlaidateDelete and delete() , delete() is called at end

    for updating a record, update() is called after AOSValidateUpdate.

    So if delete(),Insert() and Update() methods are already on table, you should write your code there after super().

    Otherwise you may override these methods (delete,insert,update) .

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 28

#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