Copy UD fields from Quote header to order header when converting quote to order

How can I Copy UD fields from Quote header to UD fields on Sales order header when converting quote to order.
I have (4) UD extended fields on Quote Head table. I want to write (copy) these fields to the sales order header table when converting the quote to a sales order.

Is there an easy way to achieve this? Does it involve writing custom code?

Best way to do this is with a pre and post processing method directive BPM on Erp.Quote.CreateOrder.
In the pre, you will set up your data pass by setting either method variables or call context variables equal to your ttQuoteHed custom field values. In the post processing, you will use field setters to set your OrderHed fields equal to the variable values or the call context values.

3 Likes

Awesome. I have built BPM’s. I did not think about that approach.
Thanks
Andy

Please feel free to mark as solved if this works for you

I will. However just looking at the pre to figure out how to pass the data for the variable. (I have built BPM’s but mainly for informational notices or missing data).
I am assuming using a method directive correct?

Yes this will be a method directive. You’ll see a field setter in the nodes, and you’ll want to set one of your call context fields there.

1 Like

Thank you for your help Aaron.
for the Post directive, Set field, the tt tables listed are the ttquote tables. I don’t see the OrderHed table listed to select the appropriate fields

These are the temporary quote tables - you’re going to want to select one of the temp tables and take the temp table’s values and write them to the actual QuoteHed (or whichever) table (I believe - correct me if I’m wrong Aaron :slight_smile: )

Sorry guys, I told you that the ttOrderHed table would be available but it isn’t. You will need to write some custom code in your post processing, I can help you with that if you need.

This, for example, targets my newly created order and sets a order detail record field from each quote dtl record field. This will be very similar, except you won’t need an iterator if you’re going after OrderHed.

Yes, I may need a little help tomorrow with the custom code.
thanks

No problem, make sure to tag me with the @Aaron_Moreng so I see the message again

Ok, I hope to not throw this conversation sideways but… That sound like a bug.

I’ll have to backtrack to find the exact code but converting a quote to order should be leveraging a ‘BufferCopy’ which should copy all UD fields from QuoteHed to OrderHed. If your fields are not coming across, something is broken somewhere (Ticket please). In other words, that should just be supported out of the box and we might have broken something in the code flow so go thru channels please to get that requested.

Next - When process flows are not as simple as what you describe, there is a little known piece of functionality - UD Field Mapping. When you are copying between two types (QuoteHed to OrderHed) the UD Field Mapping subsystem knows there is a relationship between the two types and moves the UD Fields for you - no code required.
There are relationships defined for Quote to Demand and around BOM operations. For some reason there is no Quote to Order direct relationship which is odd but fixable if you give us a kick please.

NOTE: Make sure the UD Fields on both QuoteHed and Order Hed are the same names - same types (String, int, decimal, etc). That should allow for the copying without code or bpm.

3 Likes

Thanks for the insight Bart. I will certainly put in a ticket for this. I have two UD fields that are identically named in both QuoteHed & OrderHed, those field do not automatically come over. the other (4) fields I just added to the quoteHed table with custom names, however the (4) OrderHed fields I want to copy to are from E9 days so they are the Character02-05 fields. (They are the same type & size as the QuoteHed fileds). I can try the UD field mapping if I can get the quote to order relationship established (Who do I kick to get that to happen)? thanks again for your input on the subject.

The UD Mapping subsystem is black box for end customers (sorry!). It is tied into the update pipeline so nothing you can change.

If the UD fields are aligned, we need to find out what we broke :confused:

2 Likes

@Bart_Elia
Been writing BPMs to do this for a LONG time… My understanding was that only the UD Field Mapping stuff copied automatically (if setup). It would be great to get this fixed if it is indeed a bug… but dare I say this has worked this way since 9 at least? I know we’ve written these particular BPMs for eons!
Particularly between QuoteHead and OrderHed it would seem that automatic functionality here (wihtout checks and balances) could cause problems. Since technically you can relate a Quote / Quote Line to Multiple Orders as well as reference multiple Quotes in a Single Order.

1 Like

If a UD Mapping does not exist in particular sequence, to me it’s a bug. The functional team might have an issue with that statement so insert safe harbor :wink:

Get the request in.

2 Likes

FYI, This has been escalated to a problem (PRB0191667) for enhancement or bug resolution. (quote to order mapping)

Will advise as I get more info.

3 Likes

@Aaron_Moreng, I am trying to use this in an In-Transaction Data Directive and I get the following errors:

CS0246 - The type or namespace name ‘ERP’ could not be found (are you missing a using directive or an assembly reference?)

CS0103 - The name ‘orderNum’ does not exist in the current context

Any help would be appreciated.

Sorry can you give me a little context? are you writing the code I wrote above and getting that error? What BO and method are you using

Sorry, more info would help!

I am trying to do the In-Transaction Data Directive on the OrderDtl table. Yes, I duplicated the code you showed in the picture above and am receiving those errors. Not sure what BO and method I would be using as it is the Execute Custom Code. Let me know if you still need more info.