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