One of my customers is doing some Sales Order Processing integrations with GP 2010, and for the most part, when we run into eConnect errors, it pretty much tells us what the issue is, and we fix it and move on.
We ran into one the other day and this error wasn't even the real error, so it wasn't until I looked at the XML they were trying to pass did I see what the real issue was.
The Issue
The error message was this: “Error Number = 67 Stored Procedure= taSopHdrIvcInsert Error Description = Subtotal does not match the line item totals”.
The conversation with the developers went like this:
- Devs: Hey Jen, we're getting this error, can you help?
- Me: Sure. This one sounds like we need to check that the sum of the line items we're passing matches the Subtotal field we're passing on the header.
- Devs: It does match.
- Me: Well, that's not possible… it's saying it doesn't match. Let's double-check.
- Devs: Already did, but it still doesn't work!
- Me: I'll be right over to look at it with you.
Troubleshooting
The first thing we checked was that we were all speaking the same language and that the dollar fields they were passing indeed were the same, so this error text itself wasn't the "correct" error.
We looked at this and kept looking at the dollar fields since the message was talking about subtotals not matching lines. It was clear that wasn't the issue so we then looked at the SOP line XML, and there I saw what the issue was:
For whatever reason, the SOPType on the Header and the Line were being passed two different values. They were passing SOPTYPE 3 on the line (Invoice) and SOPTYPE 4 on the header (Return). GP in theory was comparing the dollar values in the context of the document type and realizing they weren't a match.
Of course, the error text REALLY should say "The SOPTYPE on the header does not match the SOPTYPE on the line", and it would have all been a little more obvious!