Executing a Function from the Function Record
Copado allows you to execute a function from multiple places. In this article, you will learn how to execute a function from the Function record.
Once you have finished building your function, you can run it straightaway from the Function record and check if everything is working as expected by clicking on Execute Function:
When you execute a function, if any parameter needs to be passed (either because it was defined in the parameters tab, or you want to add it during the execution), you need to enter a context id, which is the Salesforce Id of the record you will be retrieving these parameters from:
Once the function is executed, Copado creates a Result record with the job status. You can see this status on the Function Results chart on the Function record (if you cannot see this chart see the Adding the Functions Result Chart to the Function Record section below):
Alternatively, you can navigate to the Results record from the Execution History tab. This Result record includes the logs attached so that you can further troubleshoot the issues if the job has failed.
Adding the Functions Result Chart to the Function Record
The Function record includes a Function Results chart that displays information about the function execution. To ensure this chart is displayed, follow these steps:
- Click on the gear icon at the top right corner of the Function record page, and then on Edit Page:
- Click on the Function Results section and set the Filter By field to Function ID:
- Save the changes and click on Activate.
- Next, click on Assign as Org Default.
- Select the device where you want to make this page available (desktop/phone) and click on Next.
- Lastly, click on Save.