Best Practice for Updating Multiple Tables

I am looking to update fields on multiple tables/forms during one transaction inside Epicor and want to know the best practice as to how I go about it.

I am planning on having our Sales Order form reflect and changes made to the Quote form in regards to a specific field. We are making changes to freight costs that get spread out among all lines on the DocUnitPrice on the Quote and when saved need to get reflected on the appropriate Sales Order on the DocUnitPrice lines. It would be easier if we could just update the Sales Order separately and not worry about going back to the Quote but the requirement is that freight needs to be adjusted on the Quote when they get the true freight value after the Sales Order is already shipped and completed and then reflected on the Sales Order when the Quote is updated.

@IanCastellanos why? That’s what I would be asking, is this just for reporting purposes? If so I would be building a report and not want to mess about with trying to change things after the fact. The quote is won and quoted by that point and changing it will be a real pain.

Are they asking to apportion the freight based on the volume or weight of each line as well? What happens if your sales staff want to duplicate a quote in future?

If you have Landed cost there is a process of disbursment that allocates costs over multiple lines, so I am guessing that is the sort of thing you are wanting to do.

Quite apart from the sensible questions @Hally asks …

I couldn’t define best practice, but I believe you’re right to be wary.

We do keep some fields tightly in sync between different tables, but I don’t think we’ve dared for any system-critical ones, only fields we’ve put in for our own purposes. Personally, I’d recommend looking and seeing if doing something like that could accomplish close to what you’ve been asked for - for example a UD field in each table that holds a copy of the data you want to keep matched up, that you keep synced, and then you can take action when needed and the data is found to be different. In your case, for example, if someone subsequently opens the quote to work on it.

And when we do the sync itself, the basics are in data directives on each table that check for changes in the relevant field, then update the other table if and only if the other is different. That prevents each change triggering the other, and as long as we can be confident there are no other processes hanging off the change, it seems to be enough. I’ll be interested to see if anyone has any other recommendations, assuming you really do need to do this.

1 Like

@IanCastellanos
i could not quit understand your ultimate object from doing such thing, from Epicor BPM cababilty you can update any table any where within the system by invoking the BO update method and passing the relevant parameters,

however the whole purpose of having an ERP system is to allow you to save, retrieve, control, and -logically- updates records among different areas of the business, so standard stuff should be already built in within the system, unless you need to do something special to suit your environment, then you need to design and “customize” your requirement. after analysing all possible scenarios.

i can understand from reading your post -please correct me if i am wrong- that you have a problem between the actual shipped price and the quoted price which is normal to happen in all business, -in my opinion- you can solve this issue by creating a UD field on sales order or/and on shipDtl to calculate and save the final cost based on whatever customized criterias that you think it should affect your quoting process such as date, Customer ID, Qty, etc, then create a BPM to call this cost on another UD fields on the quote when added or updated, designing this solution will provide users with the information you want and on the same time not violating the system built in logic.

That is the question I have been trying to ask for weeks is why we need it.

It is only 1 of our branches asking for this as our other branches do not need to transact this way. Unfortunately I do not have much pull and am arguing against doing it this way as it doesn’t make any sense to do it this way from a business and system logic perspective. They are going into the quote and unquoting it and then redoing the quote again. We are not only using it for reporting but using it for invoicing after the order has been delivered as well. The logic behind the process makes no sense to me whatsoever.

How our system is setup is everything essentially goes through the quote form as we have an outside program that pushes our jobs into Epicor to quote (we are a custom ductshop so every order has custom pieces). We also have a custom tab that recalculates jobs using pricing criteria we set on click. As far as duplication we just export the job again from our CAM software using the outside program as copying in the system messes up our quantities that in turn have to be manually changed anyway. We hide the freight and bury the value spread out among the lines using certain percentages so they do not see the total freight cost. Distributing the landed cost over multiple lines is what I need to get to.

I am thinking I might just pass the data into a UD field that I already provisioned for the sales order and use a BPM or custom code to do the same thing for now. Although I think the best way is to just redo the process and analyze what we need and customize the sales order form we are using to more directly mirror the quote form with all of our customizations we currently leverage.

2 Likes

UD field and BPM sounds the least painful. Just remember you want want to be aware of how that quoted flag affects changing, or not changing the quote detail.