Custom Automatic Posting of Purchase Invoices via Job Queue results in Job Queue Error (Error Mgt)

Lighthouse
Member Posts: 4
We are facing an issue where we would like to post all released Purchase Invoices via the Job Queue. If there is a validation error during posting of the invoice, it will skip posting and then move onto the next one.
I have built a 2 Codeunits to handle this. 1 to run on the Job Queue and the second to handle the call of Purch-Post.
The Codeunit running on the Job Queue has the following basic code:
if not MyPurchPostCall.run(PurchHeader) run then
LogAnError;
In the MyPurchPostCall Codeunit it is a simple Purch Post call:
PurchPost.Run(rec);
If the purchase invoice fails to post because my posting date is out of range or I have not filled in the vendor invoice number, the job queue moves on to the next invoice which is perfect, however if there are Dimension errors like "Select a Dimension Value Code for the Dimension Code AREA for G/L Account 63200." the job queue gets put in error state which is not what is required.
In further digging it appears to be linked to Error Message Management however I cannot see a way to deactivate this type of error handling.
We have tested this in various versions (BC17, BC20) and it happens both On Prem and in the cloud. I do have this working in a NAV2013R2 database but that version is very different to what is around now so it is not worth comparing.
Has someone come across this before and was able to get around it?
I have built a 2 Codeunits to handle this. 1 to run on the Job Queue and the second to handle the call of Purch-Post.
The Codeunit running on the Job Queue has the following basic code:
if not MyPurchPostCall.run(PurchHeader) run then
LogAnError;
In the MyPurchPostCall Codeunit it is a simple Purch Post call:
PurchPost.Run(rec);
If the purchase invoice fails to post because my posting date is out of range or I have not filled in the vendor invoice number, the job queue moves on to the next invoice which is perfect, however if there are Dimension errors like "Select a Dimension Value Code for the Dimension Code AREA for G/L Account 63200." the job queue gets put in error state which is not what is required.
In further digging it appears to be linked to Error Message Management however I cannot see a way to deactivate this type of error handling.
We have tested this in various versions (BC17, BC20) and it happens both On Prem and in the cloud. I do have this working in a NAV2013R2 database but that version is very different to what is around now so it is not worth comparing.
Has someone come across this before and was able to get around it?
0
Answers
-
I got the similar problem. what i observed is this is not the case when your batch post posts more then one record.
Can you try two pass two record to batch post with first one containing dimension error and second one without any error.?0
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