I had to write a custom program for Physical Inventory because the Acumatica native PI stuff doesn’t work for us. Last year it worked great and everyone was very happy with it.
This year I wanted to enhance it by automatically loading the counted quantities to Acumatica over the Web Service, once counting was complete, instead of using my SQL view, exporting it to Excel and loading it into Physical Inventory Review.
I am having an issue though where when I upload the scans to the web service, it fails with a 500 “Operation Failed” and Inner Message “Failed to insert the PIDetail Row”. The rest is just abstract stack tracing that gives me ZERO clues of why it wouldn’t persist.
This happens after several hundred scans are successfully processed.
I started by sending batches of 500 rows of test data (last years actual PI scans) to my development server. When I got that failure, I cut the batches down to 5 and output what part/location it is working on. I then hand entered all 5 of those scans to the Acumatica UI without error. I have checked that both the InventoryItem and Warehouse Location are valid and active for each of the rows.
Any Ideas what could be the issue?
Here is a sample JSON object I’m sending in the body.
My program queries the web service to determine if the InventoryID/LocationID combination exists, if so it references that row by the id (GUID), other wise it creates a new row for the combination. (Sorry this is from rows my program already processed, so it only has id’s not Location/InventoryID combinations, but since these are already resolved to ID’s I think it’s safe to say that works...)
{
"ReferenceNbr":{"value":"000030"},
"Details":[
{
"PhysicalQty":{"value":"233"},
"id":"63fcfe2a-4bbd-ef11-9657-cc96e52e6b1f"
},{
"PhysicalQty":{"value":"221"},
"id":"64fcfe2a-4bbd-ef11-9657-cc96e52e6b1f"
},{
"PhysicalQty":{"value":"276"},
"id":"65fcfe2a-4bbd-ef11-9657-cc96e52e6b1f"
}
]
}