Help debugging BPM Code

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.

  1. Widget 3:(Created FIRST to get the dataset) - we will run the Erp.Quote.UpdateExt BO Method with specified Parameters.
  2. 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
  3. Widget 2: Fill quote header - this gets the company and new quote number
    Here is the overall view:
    image

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”

Widget 1: Fill Lines:


You also need to “display” some fields from this query so that we can use them to populate data.
image

Then you map the query to the FixQ.QuoteDtl record (Bind Automatically works)
image

Widget 2 is very similar to Widget 1 (but simpler), but we need the FixQ.QuoteHeader to have the company and quote number:
image


image

2 Likes

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!

1 Like

This is exactly what I was trying to work around.

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.

DuplicateQuote from my experience just has Convert.ToString(sourceQuote) and has nothing to do with Lines =).

well… that’s what I get for notepad coding I guess :stuck_out_tongue: There are no details to iterate bahaha

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!

Instead of passing order lines to dupe, pass the SysRowID of the lines to dupe, then you can for sure find them again

2 Likes

SysRowID for the win!

Grabbed the SysRowID, dropped it into my LINQ query, bingo, bango…everything works.

Thanks to everyone that chimed in to help; it is much appreciated.

2 Likes

Great news! Congrats on the epicor victory.

1 Like