This is for Epicor 10.1.500.24
We are wanting to implement a Steel Surcharge (OrderMsc) added to Order Entry to specific line items (OrderDtl) based on part product groups. I currently have a semi-working BPM that is doing this in our test environment. I am currently working with the Erp.SalesOrder.Update method and using a Post-Processing BPM. I have uploaded a copy of my BPM for what I have so far. I am using the Update method because I would like this BPM to fire anytime a Part, Quantity, and/or Unit Price is either added or changed on the OrderDtl record.
First I have a condition that checks to see if there are any OrderDtl records and if there are then I check to see if an OrderMsc record already exists for Steel Surcharge. If there is not a OrderMsc then I am verifying if the part being entered on the line belongs to one of the product groups we will be adding the Steel Surcharge to. If it is then I am invoking a BO Method for Erp.SalesOrder.GetNewOrderMsc and then invoking the BO Method for Erp.SalesOrder.ChangeMiscCode. Then from here I am manually setting each of the fields to the values I want on the Surcharge. This is working but I was hoping I could just pull in the MiscCode from the Surcharge that was created in Epicor and not needing to set the fields for everything manually, including the percentage value, the ttOrderMsc.MiscAmt, and the ttOrderMsc.DocMiscAmt. Lastly I am invoking the BO Method of Erp.SalesOrder.MasterUpdate to update the database with my changes.
While this BPM is working and it does add the charge to the line items based on my criteria, I would much rather have the system calculate the amounts based on the percent that is on the miscellaneous charge in Epicor, is this possible?
I am also having an issue of removing the surcharge if the part is originally entered for a product group that gets the surcharge but then the line (OrderDtl) is updated so be a part that would no longer need the surcharge added. Currently in the BPM it is simply showing an informational message alerting the user to manually remove the charge, but I would prefer to have the system remove it if a condition is met. Can someone please help me with this.
While I do have a lot of experience with C# and BPM’s I have never created a BPM that creates or deletes records in the database before with using the system’s business logic. In the past most of the BPM’s we have created are either updating records already created based on criteria or outputting data from Epicor to Excel or emailing. I am sure there is a better way to do this with code than using Epicor’s built in BPM processes which is why I am posting this question for the groups help. I am fairly new to this group but I have been using Epicor 10/Epicor 9/Vantage 8 for over 11 years now.
Any help that anyone can offer will be appreciated. Thank you!
SteelSurchage - Test.bpm (146.6 KB)