How to fire a method bpm from a erp-button in application studio

,

I added an erp-button in application studio on the project detail tab and want to fire a method bpm when it is clicked. What is the easiest way to do this. See screen shot below.

Please help!

Thank you!
Richard

1 Like

In the properties of that button, in the Behavior section you can select On Click. It will create an event and open up a new tab that takes you to the new event. Then you have to setup the event.

I’ll let a more knowledgeable person chime in about how to setup the method directive. If you can’t access it directly, I am pretty sure there is a widget for a function, which is essentially the same thing as the method directive. I am just not all that used to working in the Event workspace.

To call a BO Method, just use the rest-erp widget and fill the Advanced > Rest Services and then Method Parameters options…

But if you just want to fire a method to run a BPM that’s attached to it, it would be simpler to do as @dr_dan says and write a Function and call it directly using the erp-function widget

2 Likes

Before functions were available and in the Classic customization space, I would do several things to fire a particular method directive:

Set the RowMod of the current row to “U”
Set a callContextBpmData field to a certain value (for the BPM)
Perform oTransUpdate()
Make sure and reset the callContextBpmData field after the save so it doesn’t trigger the directive unless you intend for it to

You could do a similar thing in an on-button-click event. Functions can be cleaner, though, because you aren’t necessarily firing all the other directives that might be connected to the update method.

Joe