Copy Qt fields to Order fields via SalesOrder.CreateOrderFromQuo

Hey Calvin,

I am trying to do something similar to what you were attempting. I want to push forward some character boxes from quote to order when creating a sales order from quote entry. I was using the following code which I based off of your code. I am putting this in a Post-Processing method directive on the business object quote, Method CreateOrder. Any idea why this is not working?

for each OrderDtl where OrderDtl.QuoteNum = ttQuotedtl.QuoteNum, 
each QuoteDtl where (ttQuoteDtl.Company = OrderDtl.Company and ttQuoteDtl.QuoteNum = OrderDtl.QuoteNum and ttQuoteDtl.QuoteLine = OrderDtl.QuoteLine) no-lock. 

  if available OrderDtl then do: 
  Run lib\UpdateTableBuffer.p(input BUFFER OrderDtl:HANDLE,'Character09',ttQuoteDtl.Character09). 
  end. 
End.


Thanks

Daniel

I need to copy fields from the quote when using 'Get Opportunity/Quote' from within the Sales Order Entry program.


I can successfully copy the field I need (QuoteDtl.Number10) when pushing a Quote to an Order (with the Quote.CreateOrder BPM), but can't seem to do it when pulling a Quote into an Order.


The following "works", but with the unacceptable side effect of updating all orders that were created from that quote. 


for each OrderDtl where OrderDtl.QuoteNum = iQuoteNum, 

each QuoteDtl where (QuoteDtl.Company = OrderDtl.Company and QuoteDtl.QuoteNum = OrderDtl.QuoteNum and QuoteDtl.QuoteLine = OrderDtl.QuoteLine) no-lock. 


  if available OrderDtl then do: 

  Run lib\UpdateTableBuffer.p(input BUFFER OrderDtl:HANDLE,'Number10',QuoteDtl.Number10). 

  end. 

End.


I tried adding that first line include: AND OrderDtl.OrderNum = ttOrderHed.OrderNum 

But that makes it so that none of the OrderDtl records are updated.  Turns out that ttOrderHed is not available when this code runs.


Any ideas of how to limit the code above to be just for the Order that is just created?


TIA 


Calvin