Update BO.Part from Custom Code in BPM Workflow

Hi I’m trying to update the unit price to the Erp.part table from custom code in BPM sistaxis it’s ok , I saw examples in other topics so please take a look in the picture to see the code

the ttUD100a_rows list tham i’m iterating contains the partNumber and the unit price that I will use for the update

What is the usecase you are trying to solve? Have you tried an Updatable Dashboard?

You have a few anti patterns here, you are creating a partSvc for every row passed into the Update, this may be just one row but it is better to do this once if you have modified rows.

Search this forum to see how RowMod, you should filter your ttUD100a rows by row mod for those that are added or modified (depending on your need) and then pass the intent in the tableset to the Update method.
You should also be more defensive, what if the passed in character01 is not a valid part, using a try catch is quite expensive when you can do a PartExists. Hope that helps.

1 Like