Hands on 4 – calling an Apex class from Process Builder
Process Builder allows you to call an Apex class that includes methods annotated with @InvocableMethod
. By calling an Apex class from Process Builder, you can add customized functionalities, such as auto-converting leads, deleting records, or running lead assignment rules. You can also pass a required value into Apex class variables.
When no other process actions can get your job done, by calling an Apex method, you can add customized functionality for your users. You can only call an Apex class from Process Builder or Visual Workflow that have the @InvocableMethod
annotation. This means that it is possible to extend the Process Builder functionality by writing an Apex class that executes your business logic, and then invoking the Apex from your process. If the class contains one or more invocable variables, then you have to manually enter values or reference field values from a related record.
Let's look at a business scenario. Suppose...