I'm working on a legacy system (Nav 4.03). When sales invoices are posted, I need to make sure that certain code runs, regardless of what exactly triggers the posting of the invoice. I used to be able to handle this, having a place in the posting routine that would surely ALWAYS run during the posting of an invoice. But as the system is extremely modified (even with it's on set of sales invoice header / lines tables), and ... apparently various ways to drive the posting of an invoice, my code doesn't always run. (I need to run it, to check if I can close "sales contracts" which is another modification.
As I say: I have been trying to put my code into the posting routine -> it sometimes runs, but not always
I have tried to put it into the "on insert" trigger in the sales invoice header, but that trigger apparently isn't used (as the insert command isn't followed with (true).