I just did it with WIDGETS ONLY… Actually was fairly easy. NO C# CODE REQUIRED! It takes THREE widgets. The beauty here is that SAAS, MTSaas, or anyone that doesnt know C# code can make this work.
This is POST PROCESSING on the Quote Duplicate Method.
Widget 3:(Created FIRST to get the dataset) - we will run the Erp.Quote.UpdateExt BO Method with specified Parameters.
Widget 1: Fill quote lines - this reads the TTQuoteDtl records, and also links back to the source quote, and populates a new TT created for this BPM
Widget 2: Fill quote header - this gets the company and new quote number
Here is the overall view:
Here is Widget 3: - Note that bindings 1, 4, and 5 have variables… I chose to create NEW Variables. My new dataset for the quote is called “FixQ”
I just realized ONE potential flaw… this assumes that you are copying ALL the lines… if you skip one, then the line numbers between each are different…
export.bpm (39.0 KB)
Attached is the BPM Export for what I wrote…
Thank you for the Exercise. I have needed a good example of how to use Fill Table by Query to then update fields. This proved my case that it “can be done”.
I am still learning!
My original code, as inefficient as it was, worked flawlessly if the source quote had all of the lines intact but when there was a deleted line in the source quote, it threw an exception.
Well, the widget bpm won’t throw such an error, but it also will not work if the originating quote has missing line items.
It could be tweaked to match lines by part Number instead of line item, but that would fail if there are duplicate parts on a quote. What you really need is a significant line ID that doesn’t change when duplicating.
If source quote has lines 1,2,4,5 -the new quote will have lines 1,2,3,4, and the bpm I wrote like successfully work on lines 1&2, but line 3 will not get a quantity and the new line 4(originally line 5) will get the third lines data.
You have a challenge!