We have a customer who is using various systems for their business, they are using 4 NAV EDI Interfaces, 9 EDI partners, E-Commerce Solution, WMS Interface, Microsoft Dynamics NAV 2018 CU2 and other Microsoft Dynamics 365 products. Because of that they have been following strict procedures to operate their business. So, there is a case where they are returning more quantity against the Sales Orders/Purchase Orders.
Manufacturing of Packaging Solution
Job Queue stuck in error state when Sales/Purchase Returns are imported with more quantity then ordered quantity from Job Queue.
In Microsoft Dynamics NAV as per the business logic system will not allow returning more quantity then ordered quantity against sales/purchase order.
Validations before importing the file.
To resolve the Job Queue error, I have added validations while importing the data in the system that checks “Return Qty. to Receive”/”Return Qty. to Ship” is greater than the Quantity then generate an error so that job queue goes into an error state.
Move the file after the processing into the respective folder. (Error/Processed)
Add a prefix to the file before the processing, so when error occurs, and the Job queue will re-run, the system will identify files with prefix from the import location and then move that files into Error folder. So only the correct file will be move to the further process for inserting/Validating the data in to the actual Sale/Purchase tables.
Once file is moved in error folder system will send an e-mail for the error file.
So that user come to know about there were error occurred in the job queue.
If the file is not having any error, it will be moved to Processed folder right after the import.
Job Queue will be in ready state automatically once it goes into error state.
Another customization we did is to update the job queue status to ready after it stuck in error status. So, if job queue faced error then it will be automatically updated to ready state soon after to re-run the process.
Functional way to handle.
If user agrees, they can return more quantities without associating any sales/purchase order.