We are months away from go live, and I’m looking into ways to possibly speed up some aspects of order entry via API.
For context, we built our own REST service that sits in front of the Epicor REST service so that we could handle security, the bearer token, data sources, simplifying inputs/outputs, and mostly to handle order input from our e-commerce site which is developed externally. We’d never go live if those guys had to figure out some of this stuff.
Recently I made a big pass on our logging and made changes that allows us to do some really great time studies, and I found 2 BO methods make up the vast majority of the time sink for us, and that sink grows at a odd rate the more lines exist on the order:
Erp.BO.DynAttrValueSetSvc/UpdateAttributeValuesObject - we use this to set advanced attr per line release (most lines get 1 release) which we are using as part color
Erp.BO.SalesOrderSvc/GetKitComponents - explodes sales kits, brings BOM into sales order
As far as I can tell, these methods do not actually accept more than 1 line at a time even if it seems like they might, so every line that needs a color or sales kit exploded gets an API call from us (am I wrong here?). The per-call cost appears to increase substantially with overall order size, which makes me suspect these methods are doing work against a much larger portion of the order dataset than the single line being acted on. Here’s an example breakdown:
UpdateAttributeValuesObject:
Order
Color lines
Total color time
Sec/line
280026
220
2m 51s
0.78
280034
234
3m 29s
0.89
280049
255
3m 36s
0.85
280057
261
3m 48s
0.87
280029
304
5m 09s
1.02
280045
305
5m 02s
0.99
280032
347
6m 09s
1.06
280054
452
13m 34s
1.80
280036
526
13m 53s
1.58
280019
924
45m 36s
2.96
GetKitComponents:
Order
Kit lines
Total explode time
Sec/line
280026
72
2m 36s
2.17
280045
76
3m 25s
2.70
280029
77
3m 24s
2.65
280034
86
3m 15s
2.26
280054
106
7m 38s
4.32
280036
115
6m 39s
3.47
280019
187
16m 58s
5.44
924 lines is very extreme for us but it’s a real order and it demonstrates the ramp up. Am I missing a better way to call either of these BO methods? Is there a supported way to batch these operations, or is this simply the expected cost of working with very large SalesOrder datasets through these BOs?
We have several members in this forum that fill gigantic orders for large box stores that have locations nationwide (maybe worldwide) that need to be shipped according to how they want them shipped, invoiced how they want them invoiced, etc. and we are all looking for a quicker way to figure this out.
Are you on prem I take it? Do you have a moment to talk about this over teams/share this info? It’d be a gigantic writeup to surface everything you did and incidents that you wanted to prevent.
Third party contractors I guess you could call them. They’re great guys but they have a lot of administrative overhead, If you want something done they’ll put it in a sprint and you’ll hear back in a few months kind of thing.
We would have to see your API, to see if we can identify some improvements. Like are you calling GetByID in between every call, perhaps you don’t have to. Perhaps some things can use UpdateExt instead of MasterUpdate.
The only way I was ever able to make something extremely fast was by reversing Epicors logic and going pretty much down to the LINQ Layer, or utilizing DMT Command Line and letting DMT do the work.
So, its a lot trickier to do it this way, but you can just use the Update functions and mass modify multiple lines at once without using the helper functions. This is the fastest method, but you have to have all your info right.
Sales kits also add a significant penalty to speed. If you are doing it all via API, you could probably ditch the sales kit functionality in Epicor and just do the equivalent via API.
Another way is to split the sales order into multiple sales orders.
Or if you cant do that, you can have the sales order made up of fewer lines, and each line is a Job that has whats actually required. Basically, each “kit” would be a single line on the sales order that is actually a job, not each kit line added to the sales order. Than the job would have all the “sales kit lines” as the materials. You get basically the same functionality with a different process and better responses time.
One of the big issues I ran into with Orders with too many lines is that the actual Shipping of lines on the order was extremely slow, and this was regardless of using the entry screen or doing it via API.
Epicor reallllly cant handle large sales orders well at all.
That’s the huge kicker. We often have to change jobs because our customer changes their minds on different things they want for each of their locations and they expect us to change on the fly. Trying to do these changes when the jobs with jobparts are linked to 5000+ releases is wicked- let alone just trying to do a straightforward shipment of one of these orders.
DMT is so insanely slow though, and I dont understand why. We did a mass update to add parts to the System and DMT for the exact same parts list took 1.5 hours whereas doing it via the api took me 3-5 minutes.
I think one of the big benefits with the API is you can do things async whereas DMT seems to only do 1 at a time.
Yeah, it would be rough if you tried using the base functionality of Epicor to do it, but you can make a UI screen that can handle all of it.
A place I was at had a big issue with Sales Orders and Kits and they were using PCID’s to ship, and the Epicor process and speed was so bad I had to make a custom app using the API to get any decent functionality and speeds out of it.
PCID’s and kits also dont let you pick which line items get filled, so if you had multiple kits with the same part on the sales order, it would just randomly pick which line item to ship to so we had a bunch of partial kits shipped, even though we picked/shipped on a kit basis so I had to handle that too.
You could do a baq that would connect jobs to sales orders and list everything out all flat like it was just on the Sales Order and with a custom UI you could handle all the logic of adding/removing from jobs/sales orders. Shipping is straight forward, especially if you use the Material Que. You just name all the jobs after the sales order with a dash whatever number and pick to the job, using job fulfillment to calculate order fulfillment. Then once the job is fully picked you can either send it to “review” or autoship it.
There are a few options here. If you want to look at engaging with Epicor CSG they can utilise the High Volume Import framework which we have done with some other integrations - It is a little harder for partners to do this at the moment.
As each order is a unit of work you can run multiple sessions to import the order
Options:
Concurrent Sales Order Orchestration (Azure Function from Queue multiple threads) Azure Functions scale and hosting | Microsoft Learn
There are a few tricks to optimise this like ReadyToCalc and some option parameters to tell the system you do need everything refreshing on each save.
ECC Service is optimized for taking orders and processing them you can use this without using ECC
Demand Management Import
HVI CSG Import (High Volume Import)
Stephen Edginton
This is the only answer I ever got from Edge when he was around how they handle large orders. I assume Epicor Customer Connect (ECC) has different BOs that could be used. I know they have a Customization, not sure what it is, or you hijack Demand Management (EDI).
I would love to see what CSG HVI is and how it works.
Jonathan, I appreciate you sharing a solution theory/something you made come true. I guess it’s our hope that Epicor would step in and develop/maintain this type of solution as most of us are manufacturing companies trying to focus on manufacturing and not software development/upkeep. I know it’s inevitable in some places, I just wish that with the number of customers dealing with this need and the easily identifiable constraints, we could work together and do something about it, develop and pay for a solution with Epicor. Maybe utilize yours as a framework.
I share your frustrations on that, though unfortunately I feel Id be quite old by the time Epicor resolves any of this, considering how long its been an issue and what with the current direction things have been going in, well I dont feel like performance is something they care about.
All I did was spin up a Javascript app on a local server and created UI’s for needs. I primarily did this because dev time was much shorter rather than trying to customize screens in Epicor, and it was a lot easier to integrate non-Epicor services.
If it is something you’re interested in pursuing though, you could start a new forum post, tag me on it, and give a quick of what you’re looking for?
I know this one is a big one, especially for larger companies, but from my point of view, if you have a decent documentation process its almost definitely cheaper to hire JS developers or contracters than it is to hire Epicor consultants. Granted you do need to still handle the API side of things for them as they wouldnt be familiar, but that can be handled in functions pretty easily as well if someone isnt familiar with coding for API’s.
I really appreciate everyones input. The API code is a little crazy, I have like 10 different steps that kick off in their own background thread so I can return an order number and job GUID so the ecommerce can query the APIs status. The slow down steps really are just straight calling those two methods though, it takes that long to get the response back. Sorry Taylor I did see your offer to talk over teams, my schedule is too insane today I think.
How do you guys reverse engineer/see what these methods are doing? I’d love to just do a bunch of stuff in a function custom code block myself if I could just see what kind of extra unnecessary shenanigans BO method x or y was actually doing.