BPM Help - Invoke UpdateExt from Update?

I am working on UD100/UD100A and want to have a button that goes and looks at a different table and adds 10-20 rows to the child table from that. I was able to create a working BPM to fill the child table when testing from a different method. With that said, I am now trying to make the BPM to fill the child table fire from a button click. The only way I know how to do that is to have the button change a field on UD100 and then have update run.

I tried to put the BPM on UD100 Update post-processing. The BPM needs to call UD100 UpdateExt to fill the child table and I get an error that I am trying to add a duplicate record to UD100. This error happens after the child table gets filled, but those records get rolled back at the error.

I’m assuming there is some issue with doing a nested update. Any ideas on how to make something like this work?

Error message for reference. The values relate to a UD100 record, not a UD100A.

Instead of doing it in a BPM can you do it in code on the customization instead? You have to get your fields from either a grid you embed or a dynamic query, but if you can get that you can call the BO from the button click event.

It’s similar to this thread where I learned how to call LaborUpdate in code.

The other option would be to build the BPM on a UBAQ and call that BAQ with your button. Depending on what you are doing that could be easier or harder.

Last edit: on the error, maybe you just need to change your RowMod to U instead of A?

I’m sure someone can code it into the customization but my version of coding is stealing bits and pieces from here with a lot of trial and error which may not be enough for this. That will be next if I can’t get this BPM to work but I feel like I’m sooo close since it works when it isn’t on the UD100 Update method.

For the rowmod - I had it set to U already but I can try A I guess.

So you do understand that UpdateExt calls Update and it call Update in such a way that the BPMs on Update will run? Unless you are conditionally calling UpdateExt so that it would only get called once, if you did not hit the error you would have an infinite loop (I believe Epicor would catch it after 1000 iterations and then fail).

Why are you not able to do the Child Table update from the Post Processing of Update instead of calling UpdateExt and having it do the Child Table update?

can you actually see what duplicate row in your test data? and i agree with you doing it with a BPM should be your 1st solution, however you need to trigger your BPM when the event of ‘click’ this button occurs on the UI , then on the UI customization, simply add a code to set any chosen BPMCallContext parameter to true, then put the row mod to update (U) then run the update, this will trigger your BPM becouse it is set as condition “true” at Update method directly, the code i use for that is:
Note: do not forget to set it back to false after your process finished.

private void btnName_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
EpiDataView edvCallContextBpmData = ((EpiDataView)(this.oTrans.EpiDataViews[“CallContextBpmData”]));
System.Data.DataRow edvCallContextBpmDataRow = edvCallContextBpmData.CurrentDataRow;
if ((edvCallContextBpmDataRow != null))
{
edvCallContextBpmDataRow.BeginEdit();
edvCallContextBpmDataRow[“Checkbox01”] = true;
edvCallContextBpmDataRow.EndEdit();
}
EpiDataView edvTableName = ((EpiDataView)(this.oTrans.EpiDataViews[“TableName”]));
System.Data.DataRow edvTableNameRow = edvTableName.CurrentDataRow;
if(edvTableNameRow != null)
{
edvTableNameRow[“RowMod”] = ‘U’;
oTrans.Update();
}
}

Note: obviously your Table must has an functioning RowMod field.