Executing a Function
If you have gone through the Introduction to Functions article, you may already know what a function is and how you can build one.
In this article, you will learn about the different options you have to execute a function. Copado enables you to execute a function from different places, such as a Function record or a Salesforce flow. Let’s take a look at the options below:
- From a Function record. You can use the Execute Function button to easily run a function from a Function record. For more information about this, review the article Executing a Function from the Function Record.
- From a Salesforce flow. You can leverage the Invoke Copado Function Apex action to execute a function from a flow. For more information, check the article Executing a Function from a Salesforce Flow.
- As part of a deployment. You can learn more about this in the article Executing a Function as Part of a Deployment.
- Using Apex Anonymous or from a custom Apex class. For more information about this option, review the article Executing a Function from Apex.
Leveraging System Properties
A system property is a value that is stored in Copado and can be referenced in a function. System properties are similar to environment variables; however, they can not only be linked to environments but also a pipeline, a user or any object record.
When you create a function, you can reference system properties in the Parameters section, and these parameters are replaced based on the context once the function is executed.
For more information about this feature, please check out the Dynamic Expressions article.