Hi everyone
I am trying to update a SO by using REST V1 Erp.BO.SalesOrderSvc
First I tried to use
the OData [PATCH] [/SalesOrders({Company},{OrderNum})]
by sending as parameter the companyID, Order number and then the following JSON
{
"Reference" : "MyReference"
"RowMod": "U"
}
and the result is
Error 400
"odata.error": {
"code": "",
"message": {
"lang": "en-US",
"value": "The request is invalid."
},
so, then I changed to Custom methods, first I tried with the MasterUpdate, (same method that is using the Form in Epicor) and it didn’t work, I tried to used Update and UpdateExt and I got the same result
I used the following JSON formats
{
"parameters": {
"lCheckForOrderChangedMsg": true,
"lcheckForResponse": true,
"cTableName": "OrderHed",
"iCustNum": "86",
"iOrderNum": 0,
"lweLicensed": true
"ds": {
"OrderHed": [{
"Company": "XXXX",
"OrderNum": 0,
"OpenOrder": true,
"PONum": "",
"CustNum": "86",
"CustomerCustID": "XXXX",
"BTCustNum": "86",
"BTCustID": "XXXX",
"ShipToCustNum": "86",
"ShipToCustId": "XXXX",
"ShipToNum": "",
"NeedByDate": "2019-07-17T19:47:17.156Z",
"ReturnDate_c": "2019-07-17T19:47:17.156Z",
"ShipViaCode": "0010",
"ReadyToCalc": true,
"TermsCode": "30D",
"UseOTS": false,
"OTSName": "",
"OTSAddress1": "",
"OTSAddress2": "",
"OTSAddress3": "",
"OTSCity": "",
"OTSState": "",
"OTSZIP": "",
"OTSResaleID": "",
"OTSContact": "",
"OTSFaxNum": "",
"OTSPhoneNum": "",
"OTSCountryNum": 0,
"CurrencyCode": "EUR",
"WebOrder": true,
"WebShop_c": true,
"RowMod": "U"
}
]
}
}
}
{
"lCheckForOrderChangedMsg": true,
"lcheckForResponse": true,
"cTableName": "OrderHed",
"iCustNum": "86",
"iOrderNum": 0,
"lweLicensed": true
"ds": {
"OrderHed": [{
"Company": "XXXX",
"OrderNum": 0,
"OpenOrder": true,
"PONum": "",
"CustNum": "86",
"CustomerCustID": "XXXX",
"BTCustNum": "86",
"BTCustID": "XXXX",
"ShipToCustNum": "86",
"ShipToCustId": "XXXX",
"ShipToNum": "",
"NeedByDate": "2019-07-17T19:47:17.156Z",
"ReturnDate_c": "2019-07-17T19:47:17.156Z",
"ShipViaCode": "0010",
"ReadyToCalc": true,
"TermsCode": "30D",
"UseOTS": false,
"OTSName": "",
"OTSAddress1": "",
"OTSAddress2": "",
"OTSAddress3": "",
"OTSCity": "",
"OTSState": "",
"OTSZIP": "",
"OTSResaleID": "",
"OTSContact": "",
"OTSFaxNum": "",
"OTSPhoneNum": "",
"OTSCountryNum": 0,
"CurrencyCode": "EUR",
"WebOrder": true,
"WebShop_c": true,
"RowMod": "U"
}
]
}
}
{
"ds": {
"OrderHed": [{
"Company": "XXXX",
"OrderNum": 0,
"OpenOrder": true,
"PONum": "",
"CustNum": "86",
"CustomerCustID": "XXXX",
"BTCustNum": "86",
"BTCustID": "XXXX",
"ShipToCustNum": "86",
"ShipToCustId": "XXXX",
"ShipToNum": "",
"NeedByDate": "2019-07-17T19:47:17.156Z",
"ReturnDate_c": "2019-07-17T19:47:17.156Z",
"ShipViaCode": "0010",
"ReadyToCalc": true,
"TermsCode": "30D",
"UseOTS": false,
"OTSName": "",
"OTSAddress1": "",
"OTSAddress2": "",
"OTSAddress3": "",
"OTSCity": "",
"OTSState": "",
"OTSZIP": "",
"OTSResaleID": "",
"OTSContact": "",
"OTSFaxNum": "",
"OTSPhoneNum": "",
"OTSCountryNum": 0,
"CurrencyCode": "EUR",
"WebOrder": true,
"WebShop_c": true,
"RowMod": "U"
}
]
}
}
and I always received the following error
{
"HttpStatus": 400,
"ReasonPhrase": "REST API Exception",
"ErrorMessage": "Parameter lCheckForOrderChangedMsg is not found in the input object",
"ErrorType": "Epicor.RESTApi.ErrorHandling.ApiException"
}
except for the last example, but I am sending the parameter lCheckForOrderChangedMsg
I also tried to change the RowMod: for “A” instead “U” and I got the same result…
my question is,
What am I doing wrong?
do you have an example of the JSON that is working?
do you know if the services is working? I have knowledge that some of the services are not working properly
has anyone try to created/ update SO using REST?
if this REST services is not working, do you have an idea about how to update a SO using REST
thanks for your help