I’m trying to take a modify a WebOrder (through ECC and Magento) as it comes into Epicor. At the end I’d like to possibly add a second Release, so while I’ve used DDs to edit WebOrders in the past I’d like to use a Pre and Post Proc directive for this.
I’m not sure how to trace business objects using a web order though. What’s odd is, I used SO.Update to grab a new WebOrder Header as a test and it worked fine. I wrote a change to a dummy text field and saw it in the DB. I can’t get it to grab a new Release the same way though.
So just real basic: SO.Update PreProc (also tried MasterUpdate and ECCUpdate for the fun of it)
Condition: At least one added row in ttOrderRel
Set Field: ttOrderRel.RefNotes of the added row to “some text”
And it doesn’t work. Works perfectly fine if I do OrderHed on SO.Update. What am I missing?
Oh… yeah I forgot that its auto created. Dang so how could I do this outside of a DD? THe main thing is to set the Plant based on criteria we have in a UD Table, and if need be to create a second release to fulfill from our 2nd Plant.
I did the first half with a DD for our first website and that worked great, but for this second website our added criteria is that if one Plant can’t fully fulfill the release we’ll ship partial from both plants. A direct insert to OrderRel from a DD is definitely not what I want to do.
Actually… Do I even need to view the Release in the PreProc? If I grabbed a new WebOrder then analyzed the Line in the PostProc to decide if its fulfillable from one or the other, could I grab and set the Plant and Qty for Rel 1 and create the 2nd release in the Post Proc?
Did you do a trace? I believe there are methods called like ChangeRelQty and whatnot. Also are you sure you are not getting into an infinite loop calling update from updat?
Well I don’t know how to trace the weborder. I just read the XML errors. I set up a Test scenario for Sales order Entry that’s pretty bare bones, basically just checks for an added Line, calls the Post and runs that code. I traced that and didn’t see anything weird. Doing it this way I did notice part of the issue is that the Line doesn’t have a Line Number yet in the Post so that’s a problem, unsure if the WebOrder suffers the same problem.
I suppose it could be looping but I’m not sure how else I’d approach doing this. I had similar issues using the Invoke Bo Method modules in the BPM as the code. Do I need to be calling Update at the end? I’m kinda just copy/pasting code that seems to be what other people used to accomplish something similar.
Open to suggestion on the approach here. All I really wanna do is grab new weborders and assess the required quantity for each line and if we can’t fulfill from Plant A, then create a second release and fulfill the rest from Plant B.