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.
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?
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 )
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.
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.
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.
@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.
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
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.