Use a BO in Custom Code to Update

Hi Epicor community,

I am trying to update a record through a BO call in Custom Code within BPM.
I have not found any samples for update, all samples that I have seen are GetNew.
Why I need to use BPM and Custom code is that this needs to be done when certain checkboxes are selected and user clicks on save (BPM call) and then a series of conditional evaluations (there is some calculation involved, it is not a simple if statement) a certain decision will be made (Custom Code) and then need to run a BO.
If you are interested to know, the BO I am trying to call is Credit BO, to override a Credit Hold.

The closest thing that I have found it terms of clarity is this:

Would you be able to provide a simple working example so that I can replicate?

Many thanks,
Shizar

You should be able to create a variable of the type the Credit BO takes as an input, and have your custom code set the dataset per your special calculations. Then th next widget would be an Invoke BO method, with your variable passed as the input.

Note your variable will need to be defined in the scope of the whole BPM, and not just inside the Custom Code.

2 Likes

Hi @ckrusen
Thank you for your response.
Any chance you can provide a few lines of code or refer me to the documentation somewhere?

I will also have this in mind:

> Note your variable will need to be defined in the scope of the whole BPM, and not just inside the Custom Code.