Code Assistance for BPM

Looking to see how I should identify a row in code for a BPM. I am using the Execute Custom Code widget and am trying to isolate rowNum 0 when it is added.

I know the following works

var ttQuoteOprRow = ds.QuoteOpr.Where(Q=>Q.Added());

Is there something that I can use to check to see that the row number is also 0? I’ve searched online and in the ServiceModel methods and have not found anything yet.

So you want to check for the first line of the ttQuoteOprRow? Or are you looking for the position of the added row in the ds.QuoteOpr dataset?

1 Like

@Doug.C thanks for responding.

I think I see where you are heading. Do a count of the rows in the table to see if it is the first one and go from there?

Why do you want to isolate rownum 0? It seems like you will only get the added row, or are there more than one added row in the dataset?
if you only want the first one, consider changing your query to:

var ttQuoteOprRow = ds.QuoteOpr.Where(Q=>Q.Added()).FirstOrDefault();
2 Likes

@timshuwy what I really wanted was to set a BPM field when the first operation was added to the QuoteAsm, but I was not really thinking it through correctly. Doug’s response pushed my brain in the right direction and I realized all I had to do was test the count of rows in the table to see if it equaled 1.

You are correct though, there would only be the added row at that point. I tend to overthink my code when I’m trying to come up with a solution.

1 Like