Copy UD field from QuoteHed to OrderHed when converted

This is probably simple, but this will be my first BPM so would like a little help.

I have added a UD field to both the QuoteHed and OrderHed named “Description_c”. We like to give our Quotes and Orders descriptions to make it easier to remember what the Quote or Order is. I simply want to copy the “Description_c” from the QuoteHed to the OrderHed.
I thought creating a Method Directive on the Create Order from Quote would be the place to do this, however I can access the QuoteHed, but not sure if or how to access the associated OrderHed.
Maybe I am looking at this all wrong, I appreciate the feedback.
Sorry such a newbie question.

So what do you have so far? Sounds like you are on the right track. Did you do a trace to see what happens when you make the order from the quote?

There are some caveats with the specific task that you are doing that I’ll let you know about. First, there is more than one way to pull a quote into an order, and they use different methods. One is from the quote, pushing it to the order, the other is from the order, pulling it from the quote. So you’ll actually need BPM’s in both places for it to work all of the time.

With the BPM, your only going to have one data set available, (the one it came from) so you’re going to have to do some lookups (from the order side) and updates to the order (from the quote side) to make that work.

But you have parameters that come through that will help you do that. So if you look in either a custom code window, or a set field with a function, if you right click, then you will get some parameters that can help you find the other side of the equation. Using that, you’ll have to do some more legwork.

image

So to make this work, do a trace where you do all of the work manually. And you should be able to follow what Business objects (BOs) and methods are being called to make it work manually, and you would follow that in your BPM.

For what it’s worth, something like this that should seem simple, is actually kind of a pain, just because of how it’s set up.

If you’re still reading, I will throw out another possibility for you, and that is if you don’t need to make changes on the order side to this equation, you just do a lookup on the order to go lookup the related quote description. Then you only actually have to store it in one place. There are a couple of ways to do that. I believe a foreign key view in a customization would work, or you could look it up in a BPM then display it somewhere. I’d to play around with how I would make it work exactly.

Thanks lots of good stuff there.

As I said I am new, I skipped the trace step. I will have to go back and figure out how to do that properly.

To set a field in another table (i.e. if I do the Quote Convert to Order Method) will I be able to actually set a value in a table that is not directly available? I am still learning what is possible.

I did lightly think about the fact this could happen in a few different ways, in fact recently during POC sessions we were looking at pulling Quote lines from other Quotes into an Order. That would have odd implications on this BPM. I think I need to plan one or maybe two ways I can promise users it will work and outside that they will have to edit the field manually.

I see your point about using a foreign key to simply reference the Quote Description on the Order. While that sounds very tempting, there will be times they will create Orders without Quotes and I am sure somone will tell me “We always change the Description on the Order…” (Then why am I doing this in the first place, grr…) Sorry a little frustration slipped out :wink:

Thanks again, will look into the trace.

PS I have some VB.net coding from my long lost past (last week, LOL managing old code) and have a knowledge around C# and fair with SQL so if this is done through those methods I would be pretty comfortable.

Yes, it’s all possible. You can forcibly do quite a bit in epicor. It’s the classic battle of “Can” and “should”. Since, in this specific case you’re dealing with UD fields, there really isn’t a lot of harm in skipping epicor BO’s since they don’t know anything about your custom fields anyways. That’s generally called a Db Update. But with fields that are native epicor fields, you really shouldn’t do that.

The related quote is stored on the line, so it would actually make sense to store the description there, but now you’ll have a description per line.

You’re hitting the real problem of most development requests and that is, people want something, but they won’t sit and think about the logistics of what they actually want. That’s a harder problem to solve than the technical part of it. If they can’t make a valid flow chart with clear decision points on how it’s supposed to work, then it’s not really a valid request.

1 Like

Epicor should handle the copying of Quote values to Order for you, did that break. You can also use UD Column Map

I looked at that, they don’t have quote to order.

Couldn’t agree more… spot on!

Anyway, I just went through the whole QuoteHed to OrderHed and QuoteDtl to OrderDtl UD field copy situation myself… It was stupidly complex. There is Create Order from Quote where you do need a BPM (and you need to use a Function if you’re going to do it right through the Business Objects because there is a bug where you can’t reference the Sales Order BO from within a Quote directive). There is Get Quote from within Order Entry where UD fields automatically copy if they have the same exact name on each table (stupid us had slight variations in field names). There is Get New Line from Quote (when you’re in Order Entry and have already started an Order) where UD fields do not copy from quotedtl to orderdtl so you need another BPM. And then there is the question of Duplicating Quotes and Copying Orders. UD fields will copy, but do you want them to? We had some that should copy and some that should not copy…

I have the same requirement, but I have dozens of UD Fields that need to be copied. I use an In-Transaction Data Directive on OrderDtl for this. If you go down the replies a bit, it shows someone using the “Fill Table From Query” widget to map the Quote field to the Order field. You could definitely use the same logic for OrderHed.

https://www.epiusers.help/t/bpm-to-copy-ud-fields-from-quotedtl-to-orderdtl-when-creating-order-from-quote/103841

The trick for OrderDtl / QuoteDtl is to use an in-transaction Data Directive on OrderDtl where there is an Added Row and the OrderDtl.QuoteNum != 0 and OrderDtl.QuoteLine fields != 0. This covers all of the Quote => Order Creation methods.