We currently use rest api to add sales orders from our website into E10 but we are having some issues with Sales Kits. If a sales kit part is added via the website using API the other lines don’t seem to understand how to jump to the next line number automatically.
Anybody else have this? I have the same problem with Postman, I need to change the line from 1 to around 8 as the Sales Kit took 7 lines but are not showing up on the Sales Ordery Entry screen.
In the REST API when you call the GetNewOrderDtl it should come in with the next available LineNum pre-assigned and then you make changes to everything besides the defaults and Update, no?
For SalesKit I think you need to use GetNewSalesKit
I’ve not used REST, but thought it processed similar to DMT (by using the underlying BO and Methods). So shouldn’t added lines use 0 (zero) for the OrderLine?
You will save yourself alot of headaches by using the Custom Method’s – there is alot of logic it handles for you. Such as looking if Backflush is enabled, setting the SellingQty properly etc…
I would recommend you go to POSTMAN and step through making a new order line on an order. It should take you few minutes.
The same concept will be in code then.
GetByID(orderNum)
GetNewOrderDtl
Update
In your php code basically each call should return the dataset you will keep passing like a ball to the next API Call
GetByID(orderNum) : returns All Tables for that Order (OrderHed, OrderDtl, OrderRel…)
GetNewOrderDtl : creates a new OrderDtl with defaults figured out and RowMod = “A”, you make changes
Yeah I’ve noticed the datasets in the methods that’s where it got ugly for me. I’m not the biggest of coders and this was a challenge in the first instance.
Thank you for the head ups. I will look into this and make some improvements as I go along… It’s been working flawlessly but the Sales Kits are just causing a little bit of a problem.
Maybe @josecgomez or @jgiese.wci have a php starter boilerplate. I love php used it for years, but I dont have a quick example code to share. Maybe they have a helper function or class that makes it easier.
Sorry to bring this one up but I wanted to message as I’m in a similar spot. I use PHP to access the REST API and create sales orders. It’s been working without issue for a long time.
But in a recent post I made, we are seeing an issue with sales kits. It appears it’s not back flushing. Parts show up on the order and everything fires right in that way. It just doesn’t pull the parts from inventory for some reason.
I’m wondering if @aarong you ran into this problem and possibly solved it. If not, oh well.
Are you creating the lines yourself? If so then stop! Let epicor generate the lines for you.
If you arent generating the lines then look up the part for the part type being Kit and make sure in the foreach loop. Its added last as when kits are added they create several lines and it screws with the api foreach.
I just add the sales kit as a part to the SO. Let epicor do all the work.
I hate to say it but it looks like it’s working on my end.
I took the other coworkers word that it wasn’t working and I didn’t pull a time phase to see what was going on. I instead went looking at the API and checking everything was being entered properly on the sales order side. Everything was working so then I thought, check time phase. Sure enough it’s working as it should.
I think the issue here is they are saying inventory is off. Not because of Epicor but because of people in the warehouse not doing counts properly.