AfterFieldChange code error

A little update and maybe you can help point me in the right direction

So the code is “technically” working but there is a little snag that I found. The code is updating all the rows in the JobOpDtl as each operation under each line is getting all the values:

Each one of these rows under operations received the 10,000 override rate that I had entered. The catch is that I had RCTDUCT selected in the left pane for the line. If I change the focus to the RCTFITT line, go the summary tab enter in a value for the PreWageRate_c and save it will update only ASM and Operations for the RCTFITT line.

So what I essentially need to do is a nested foreach statement to test at this point and see if that is what is causing my issue. I know it is more effecient to use LINQ or something but I do not know if I can use such code in the script editor. Any suggestions on how I should go about this?

Thanks

You can add a Select to narrow down the rows you want edvJobOpDtl.dataView.Table

foreach(DataRow dr in edvJobOpDtl.dataView.Table.Select("QuoteLine = " + whateverQLineColIs))
{
  // use dr here
}
1 Like

Some quotes can have hundreds of lines (not super common) so would it be easier to just add all quote lines or specific ones based on criteria in the current quote?

I am also going to add some additional statements to my initial if statement as not all lines need the rates and overrides changed. Although this is going to be a little tricky as sometime our part nums can be both custom and stock and I would also have to filter off that as well in certain cases.

Also QuoteLine is located at the QuoteDtl level so I don’t think using Select would work as I want?