Executing a Function from the Function Record

Updated 2 weeks ago by Copado Solutions

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:

Execute Function button

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:

Context Id modal

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):

Function Results chart

 

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.

Result Record

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:

  1. Click on the gear icon at the top right corner of the Function record page, and then on Edit Page:

Edit Page button

  1. Click on the Function Results section and set the Filter By field to Function ID:

Filter By picklist

  1. Save the changes and click on Activate.
  2. Next, click on Assign as Org Default.
  3. Select the device where you want to make this page available (desktop/phone) and click on Next.
  4. Lastly, click on Save.


How did we do?