REST - Receipt Lines

I’m getting a very strange error when trying to create Receipt Lines through REST. The error is:

“Epicor.RESTApi.ErrorHandling.ApiException: Company configuration does not allow this supplier price update.”

Our Epicor is multi-company and we’re able to create receipt lines in one company, but not the other. Both companies have the “Allow update of Supplier Price when Receiving” checkbox unchecked in Company Configuration. So, it’s very strange that it’s erring on just one of the companies and not the other.

If I set this Allow update of Supplier Price when Receiving checkbox on, then it will work in the company with this problem. When this checkbox is off, it’s fine when adding receipt lines using the Epicor client, but erred when done through REST.

Has anyone run into any similar or have any suggestions? Any help would be much appreciated.

Thanks.

REST uses the back end BO, try using the WCF Tester to do the same thing and see what the result is. It will help you narrow down if the issue is with REST or native Epicor

Good idea! I’ve just tried it with BL Tester and it too give me this exact same error.

The strange thing is, it doesn’t error when adding receipt lines directly in Epicor. It’s possible that we’re not passing in all fields that it needs when doing this through REST and BL Tester. However, there are so many fields in receipt detail that trying to narrow down which ones we’re missing won’t be easy, if that’s even the problem.

Any other suggestions?
Thanks.

Do a trace on the UI and see if you see any glaring missing fields?

-Jose

Found the field (DocScrVendorUnitCost). It needs that from the PO Detail.

Thanks for your help, Jose!

This saved me a lot of time today Nick, Thanks for doing the leg work.
Do you have this working in the REST 2.0 API?

I’m getting an internal server error: store update, insert, or delete statement affected an unexpected number of rows (0)

Looks like the API is accepting my call as valid and expecting a row to be created, but something is going wrong when actually writing to the DB. I bet there is some mandatory field that is preventing it from getting written, would you be able to share which fields you are populating in your call to create the receipt line?

Thanks,
Jordan

Here’s the JSON that I’m using. It seems to work.

{“IUM”:"",“Company”:"",“BinNum”:"",“ReceivedComplete”:true,“PartNum”:"",“Received”:true,“VendorNum”:1,“PUM”:"",“DocScrVendorUnitCost”:“0”,“PONum”:123456,“PackSlip”:“Nick”,“POLine”:1,“ReceiptType”:“P”,“Plant”:“01”,“InputOurQty”:“1”,“PORelNum”:1,“ReceivedTo”:“PUR-STK”,“LotNum”:“abc”,“PartDescription”:“test”,“VendorQty”:“1”,“OurQty”:“1”,“WareHouseCode”:“1”}

Nick

2 Likes

Thanks Nick,

PUM was the one i was missing. Looks like you need to include it even if the qty option is set to “Our”.
I wish there was some better documentation on these things, this isn’t the first time i’ve had to spend hours trying to find all the required fields. I’ll pose the question to support and update here if they have anything.