For a message, you can set up data synchronization to manage the export of data from D365 FO.

Use a data synchronization of type 'Table events' to use table events to log data changes. You can define, for each record, which table events are logged.
For each data synchronization record, define the desired type of the table event triggers. If you use the type 'Event handler', for each select event, you must add custom code to the related table. This can result in a better performance and can be useful for transactions like sales orders.

Custom event handler

To develop a custom event handler:
  1. Find and select the applicable
  2. Create class that extends the table
  3. In this class, implement the change of command (COC) for these methods, if applicable: insert, update, or delete.
  4. From these methods call the applicable method in the BisMessageTableEventHandler class:
    • Insert: Call the 'tableEventInsertHandler' method after the next insert.
    • Update: Call the 'methodtableEventUpdateHandler' method after the next update.
    • Delete: Call the 'tableEventDeleteHandler' method before the next delete.

Example

You can for example extend the SalesTable with a class to develop custom event handlers.

[extensionOf(tableStr(SalesTable))]
final class mySalestable_extension
{

public boolean insert()
{
next insert();

BisMEssageEventHandler::tableeventInsertHandler(..);
}

public boolean update()
{
next update();

BisMEssageEventHandler::tableeventUpdateHandler(..);
}

public boolean delete()
{

BisMEssageEventHandler::tableeventDeleteHandler(..);

next delete();

}
}

Complete this code example as desired. For example, adding the arguments as desired for your scenario.

Provide feedback