Guaranteed run of code when record is inserted (invoice is posted)

Hannes
Member Posts: 19
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).
Ideas?
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).
Ideas?
0
Answers
-
I think the better solution would be to figure out the steps that cause the code to not run, and solve that problem, rather than trying to code around the problem. Something is wrong with codeunit 80, or more likely the code that calls the posting code. Maybe some combination of the invoice and ship booleans. Code coverage might be helpful.Kyle Hardin - ArcherPoint0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions