Hello,
I had a business requirement where I had to create packing structures against purchase orders at time of packing of containers. I have achieved the entire solution except that there is one major issue. For the automation I have used the Enqueue API to import XML based files into Dynamics Inbound ASN V3 entity.
There is a recurring data job that has its recurrence set to 1 minute that communicates with the enqueue API to import that file. The issue arrives when I try to enqueue multiple files at once. Like say I have enqueued 4 files with a gap of about 30 to 50 seconds. Once the import starts via the integration, randomly out of nowhere either the second or the third or the fourth file enqueued to the API fails to import into Dynamics. Upon my investigation what happens is that when the first file comes in to the entity it inserts fine but since the record has been updated/changed in terms of dynamics the next file coming in might throw an error stating
"Cannot edit a record in Purchase Order Additional Fields (WHSPurchLine).
An update conflict occurred due to another user process deleting the record or changing one or more fields in the record."
Here's a screenshot showing the Inbound ASN V3_WHSInboundLoadPackingStructureLineV3Entity logs:

I tried the import with setting the recurrence to 3 minutes but what it did was out of the 5 files i tried importing, Dynamics threw an error on the 2nd, 3rd and 4th files and successfully imported the 1st and 5th files.
Can someone kindly shed some light onto this on how can I achieve this solution?