Crown Hill approached Redefine Dynamics to resolve their issue. To resolve the Job Queue error, we have added validations while importing data into their system.
These checks ensure that "Return Qty. to Receive" and "Return Qty. to Ship" are not greater than Quantity so that jobs will go into an error state when this happens.
We added a prefix to the file before the processing, so when an error occurs and the Job queue will re-run, the system will identify files with a prefix from the import location and then move that files into the Error folder.
So only the correct file will be moved to the further process for inserting/Validating the data into the actual Sale/Purchase tables.
Once the file is moved to the error folder system will send an e-mail for the error file. So that the user comes to know about there were errors that occurred in the job queue.
If the file does not have any error, it will be moved to the processed folder right after the import. Another customization we did was to update the job queue status to ready after it stuck in error status.
So, if the job queue faces an error it, will be automatically updated to a ready state soon after re-running the process.