Use the Run An Apex Class action to execute your Apex Classes as a DAP action. By running apex classes as an action, you can:
- Apply an apex class to multiple records in one go; in a job or from list view.
- Let you end users execute an apex class, dependent on their action assignment settings. No need for an administrator to execute the apex class!
- Monitor the flow executions in the Audit Log.
- Add custom actions to the Action Launcher, by creating a Macro based on an apex class action.
But most importantly, by using an Apex Class, you can basically create your own DAP actions! The possibilities are endless. Develop your own action, and put it to work by utilizing Data Action Platform features such as batch processing, scheduling, filtering and much more.
Prerequisites
To set up and use a Run An Apex Class action, you need:
- The Apex Class you want to run. Apex classes need to adhere to some requirements to be suitable for use in a DAP action. Find out how to create an apex class for DAP in Creating your own actions with Apex Classes.
Run an apex class as an action
- Select the records that you want to apply the apex class to in a list view, or by creating a new job.
- In the Action Launcher (top right in list view, or the next window in the DAP Job modal), select Run an Apex Class and click Next.
- Select the Apex Class you want to use. In the select list, only Apex Classes that are suitable for use in a DAP action are shown. See Creating your own actions with Apex Classes to find out how to create an Apex Class for DAP.
- If enabled, change the Chunk Size to fit the needs of the flow (available for DAP Job and Macros)
- Click Next > Start.
The Apex Class is now applied to all selected records. You can check the results in the Audit Log.