microsoft-dynamicsaxaptax++dynamics-ax-2009

What is the moment when the sales order is fully formed with its lines and the entire posting process is finished?


I would like to know where in Dynamics ax 2009 a sales order (SALESTABL) is fully formed with all its lines (SALESLINE). I need to run a code snippet right after the order (and its lines) has been created. What I want to learn is actually like "after insert" in SQL. The piece of code I want to run will look at all the lines of the order in order and do an action.


Solution

  • That's sort of impossible, because a SO can be reopened or if you have an open SO and your user has added 1 line...well who knows if the user is done adding lines? How do you know when it's "complete"? You could go off of the point of confirmation, but not everyone does confirmations. You need to determine some "point" in business that you consider "complete" and then go from there. You could trigger an event after each SO line is created if your code is written to be idempotent?