I recently successfully added my first order header with REST. I am now attempting to create order lines. The “test” header I am using as a reference is “OrderNum”: “1553”.
I am getting this error:
BadRequest REST API Exception The Sales Order Number must either be less than 1000 or enter zero to allow the system to assign the number. Ice.Common.BusinessObjectException The Sales Order Number must either be less than 1000 or enter zero to allow the system to assign the number. Error OrderHed
It’s often best to trace what the system does. You can trace a screen, DMT or make an update able BAQ.
I don’t believe any of them will use OrderDtl BO.
I think you hit the limit of rows returned by rest call. If you are not cloud customer, then you can remove it completely in web.config.
By default, Rest is set to only return first 100 records of the table. But with query like yours where you are retrieving rows from child table, that limit is first applied for the parent table and only child records of first 100 parent rows are retrieved.
For test try to add $top=someHugeNumber to your query.
@Olga@hkeric.wci
I have top within my CURLOPT_HTTPHEADER => array(. Is this syntax incorrect? I will test out top within the “call settings” and post fields see if it has an effect.
@Hally I believe you are correct about this. I am testing this call on order number 1553 though. Does the starting SO number compromise this?
I also attempted to put the top within the call settings option in my CURLOPT_HTTPHEADER => array( but there was no change - The output still gave the error " The Sales Order Number must either be less than 1000 or enter zero to allow the system to assign the number"
Come to think of it - the error is giving me the option to let the system assign an SO number. I’m not convinced I have the right swagger URL. I am attempting to add lines to the sales order headers I recently created. is /v1/Erp.BO.SalesOrderSvc/OrderDtls the place to do it?
I might be missunderstanding you here, by if your starting SO number is less than the SO number you are entering you would get the error, if it is greater then you would get no error. That’s the behaviour I have seen using the DMT at least .
@Hally I am not totally sure - this is the first time I am making this call so its all new! It is very possible that I am adding top in to the post incorrectly - but I have tried top at 5,999,1000,1001, 5000, 20000 in the postfields, header array, and header>call settings array.
The fact that regardless of what number I put into top there is no change in the response tells me I am likely calling it wrong.
According to the first error, if you have a Starting Sales Order Number of 1000, then you can only specify Order numbers from 1 to 999. Otherwise, Epicor will expect you to give it a “0” for new Sales Orders and Epicor will create the number for you.
@Jason_Woods I already have the Sales Order from a previous REST call I did to v1/Erp.BO.SalesOrderSvc/SalesOrders. I am attempting to add line items to that order. Do you think I am making the wrong call to v1/Erp.BO.SalesOrderSvc/OrderDtls?
Sorry for the late response, (just got out of bed). As @Jason_Woods mentioned Test adding a SO in the Epicor UO first, this will confirm things like the data you are passing in is valid. You can set the starting DO number in the Company Configuration. I’ll post a screenshot when I get into work.
It took a couple of days to get DMT working for myself on Pilot - I apologize for the delay.
I was able to trace this DMT to the “Sales Order Detail” table:
The result was a successful import of the data. The tracelog is… massive. As I imagine yall don’t want 19,000 lines of trace logs I will post the starting lines for the 4 packets:
So I followed up looking for the “SalesOrderImpl” service on the swagger page. Now I am pretty certain in my past hunt through swagger I saw this line… but now its nowhere to be found.