How do I create an Invocable function in Salesforce?
A list of a user-defined type, containing variables of the supported types and with the InvocableVariable annotation. Create a custom global or public Apex class to implement your data type, and make sure your class contains at least one member variable with the invocable variable annotation.
What is an Invocable action?
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 to use invocable method in process builder?
But you can call an @future method from withing the body of the Invocable method. @future @InvocableMethod (label=’label’ description=’description’) public static void inactivatePortalUsers (List ids) { } I did this just yesterday – so haven’t tested it thoroughly…..
Where to find invocable methods in apex developer?
Public invocable methods can be referred to by flows and processes within the managed package. Global invocable methods can be referred to anywhere in the subscriber org. Only global invocable methods appear in Flow Builder and Process Builder in the subscriber org. For more information about invocable actions, see Actions Developer Guide.
How are invocable methods used in Salesforce flow?
If a flow invokes Apex, the running user must have the corresponding Apex class security set in their user profile or permission set. Invocable methods are called with REST API and used to invoke a single Apex method. Invocable methods have dynamic input and output values and support describe calls.
What happens if user does not have access to process builder?
NOTE: If your Process Builder calls a Flow, and that Flows uses an Invocable Method (Apex), and the user doesn’t have access to the apex class that houses the Invocable Method, the Flow will error. Make sure the profile/permission set of the user has the class added to Enabled Apex Class Access.