Contents
How do you make an Apex class Invocable?
Invocable Actions are Apex methods that can be called from Flows, Processes and are exposed through the REST API. To create an Invocable Action you need to add the @InvocableMethod annotation to your method and away you go (OK, it’s not quite that simple, there are a few restrictions which are covered here).
How do I get to the apex class in process builder?
Call Apex Code from a Process
- Enter a name for this action.
- Choose an Apex class by entering the name of the class to filter results or select a class from the drop-down list.
- If the class includes an invocable variable, you can manually enter values or reference field values from a related record.
- Click Save.
How do you use Invocable method in Apex?
Use Cases of Invocable Method:
- The Invocable method must be static and public or global , and its class must be an outer class.
- Only one method in a class can have the InvocableMethod annotation.
- Triggers can’t reference Invocable methods.
- Invocable method will not accept more than one argument as a method parameter.
Can we call Apex from process builder?
Calling apex class from a Process builder is needed when complex logic has to be bundled in the form of an apex class and has to be automated as part of a process flow. To invoke an apex method you can use @InvocableMethod and follow the following steps: Invocable methods can have only one parameter.
Can we call process builder from flow?
Autolaunched flows can be invoked from process builder, from within an Apex class, from a set schedule, from record changes, or from platform events.
Can we call Apex trigger from process builder?
How do you call an Invocable flow method?
The invoked method:
- The @InvocableMethod annotation allows the Flow to call the method.
- Use the ‘label’ attribute to define the display name of the Apex Action.
- It can have only one parameter.
- You can have only one invocable method per class.
Can we call trigger in process builder?
Can we call Invocable method from Apex class?
Invocable methods can have only one parameter. These methods can accept only a list of primitive data types or list-of-lists of the primitive data types. For example, the developer can have List or List In any apex class, there can be only one Invocable method.
What is the difference between flow and process builder?
Process Builder works much like IF does in formulas: Condition; Actions when TRUE; and then perhaps other conditions to evaluate when the Condition is FALSE. Logic in Flows is more analogous to CASE formulas: Condition; Actions if A is TRUE; Actions if B is TRUE, etc.; Actions if nothing is TRUE.