Update Receipt QTY on REST API Call (POST /{currentCompany}/Erp.BO.ReceiptSvc/GetDtlQtyInfo)

I am working to update a receipt entry using REST API. It’s my understanding that I should be able to use the natural business methods to make the REST call and update the receipt qty, but it’s not working.

It won’t work when I use POST /{currentCompany}/Erp.BO.ReceiptSvc/GetDtlQtyInfo
But it does work when I use UpdateExt instead. The problem with this one is that the cost and freight burden are not calculating properly.

Example of POST /{currentCompany}/Erp.BO.ReceiptSvc/GetDtlQtyInfo

Input:

{
“ds”: {
},
“vendorNum”: 81,
“purPoint”: “”,
“packSlip”: “186729”,
“packLine”: 4,
“inputOurQty”: 150,
“inputIUM”: “”,
“whichField”: “QTY”
}

Response:

{
“HttpStatus”: 400,
“ReasonPhrase”: “REST API Exception”,
“ErrorMessage”: “Record not available.”,
“ErrorType”: “Ice.BLException”,
“ErrorDetails”: [
{
“Message”: “Record not available.”,
“Type”: “Error”,
“Table”: “RcvDtl”,
“Program”: “Erp.Services.BO.Receipt.dll”,
“Method”: “getRcvDtlRow”,
“ColumnNumber”: 17,
“LineNumber”: 4765
}
]
}

You need to pass in the dataset as the Trace Sends it, you are passing in an empty dataset.

1 Like

When I put values in the RcvHead and RcvDtl it still gives an error. This time saying that the Paramater ds is not in the input object.

Input:
{
“ds”: {
“RcvHead”: [
{
“Company”: “29558”,
“PackSlip”: “186729”,
“PurPoint”": “”,
“VendorNum”: 81
}],
“RcvDtl”:[{
“Company”:“29558”,
“VendNum”:81,
“PurPoint”:"",
“PackSlip”:“186729”,
“PackLine”:2,
“InputOurQty”:“100”,
“inputIUM”:"",
“whichField”:“QTY”
}]

},
“vendorNum”: 81,
“purPoint”: “”,
“packSlip”: “186729”,
“packLine”: 2,
“inputOurQty”: “100”,
“inputIUM”: “”,
“whichField”: “QTY”
}

Response Body

{
“HttpStatus”: 400,
“ReasonPhrase”: “REST API Exception”,
“ErrorMessage”: “Parameter ds is not found in the input object”,
“ErrorType”: “Epicor.RESTApi.ErrorHandling.ApiException”
}

Some helpful person pointed me to https://jsonlint.com/. Make sure your JSON validates before you send it.

2 Likes

Mark-

Thanks for pointing that out. After correcting it, I’m still getting this output.


Input


{
“ds”: {
“RcvHead”: [
{
“Company”: “29558”,
“PackSlip”: “186729”,
“PurPoint”: “”,
“VendorNum”: 81
}],
“RcvDtl”:[{
“Company”:“29558”,
“VendNum”:81,
“PurPoint”:"",
“PackSlip”:“186729”,
“PackLine”:2,
“InputOurQty”:“100”,
“inputIUM”:"",
“whichField”:“QTY”
}]

},
“vendorNum”: 81,
“purPoint”: “”,
“packSlip”: “186729”,
“packLine”: 2,
“inputOurQty”: “100”,
“inputIUM”: “”,
“whichField”: “QTY”
}


Response Body


{
“HttpStatus”: 400,
“ReasonPhrase”: “REST API Exception”,
“ErrorMessage”: “Record not available.”,
“ErrorType”: “Ice.BLException”,
“ErrorDetails”: [
{
“Message”: “Record not available.”,
“Type”: “Error”,
“Table”: “RcvDtl”,
“Program”: “Erp.Services.BO.Receipt.dll”,
“Method”: “getRcvDtlRow”,
“ColumnNumber”: 17,
“LineNumber”: 4765
}
]
}

Are passing in the string “{CurrentCompany}” or the actual company ID?

Have you done a Trace in Epicor? And are you replying this Trace?

Yes. I have the trace in Epicor , it’s how I know what mehod to post to.

What do you mean by “replying” the trace?

If you send me an email I can forward you the trace packet that I’m working with.
I don’t think I should send it on the forum.

I’m passing the actual Company ID.

I was able to find a solution to this issue.

I changed the method for updating the receipt quantities. (I changed to UpdatedExt)
I added a Rest call to disburse the freight. (POST/DisburseLandedCost)
I also added a Rest call to apply the landed cost. (POST/ProcessLandedCost).

Now I’m showing the correct quantity and material burden on my receipts.
Thanks.

I know this is an old post, but I kept getting this error too, and was able to get the right method working. If it helps anyone, here are the steps I took to fix it. I recommend using the full dataset that comes from Erp.BO.ReceiptSvc/GetByIdChkContainerID

  1. I got the dataset from:
Erp.BO.ReceiptSvc/GetByIdChkContainerID({
  "piVendorNum": 0,
  "pcPurPoint": "string",
  "pcPackSlip": "string",
  "piPONum": 0
})
  1. I passed the “resultObj” to a “ds” object: new {}[“ds”] = result:{}[“returnObj”];
  2. I probably didn’t need to, but the full trace excludes empty nodes, so I removed any nodes that had empty arrays.
  3. For the item in the RcvDtl array that matches the line I’m editing, I changed the RowMod = “U”
  4. I added the variables to the parent object to pass through. So, for this case specifically, my very abreviated model looks something like
{
  "ds": {
    "RcvHead": [
      {
        "Company": "string",
		,,,...
        "RowMod": ""
      }
    ],
    "RcvDtl": [
      {
        "Company": "string",
		,,,...
        "RowMod": "U"
      }
    ],
    "RcvDtlAttrValueSet": [
      {
        "Company": "string",
        ,,,...
      }
    ],
  },
  "vendorNum": 0,
  "purPoint": "string",
  "packSlip": "string",
  "packLine": 0,
  "inputOurQty": "0",
  "inputIUM": "string",
  "whichField": "string"
}

Hopefully this is helpful to someone who stumbles back on this

1 Like