All Courses My Courses Help Center People.ai Home

Updating Scorecard Category and Playbook Event fields in Reports for Deployed Templates

⚠️ Data from Scorecard Categories and Playbook Events will propagate into Reports based on changes made in the Scorecard or Playbook.

If you create a new Report or edit an existing Report where Templates are already deployed to one or more Opportunities, the fields will be empty.

To update the connection between the Fields and the Reports you create, run a script via the Developer Console to update the Report Fields with current information.

⚠️ You must have access to the Developer Console, ClosePlan Admin, and SalesForce.

 


Instructions

Update via Script

Make sure every deployed Template and each version you want to have in the Report is correctly configured with the fields (don’t forget to also check for archived Templates/versions)

Go to the Gear Icon > Developer Console

Debug > Open Execute Anonymous Window

Using the script below, modify the script to reflect your Template Id and email. 

Id[] templateIds = new Id[]{'a0O1U000004wd69UAA'};

TSPC.CPSJob_DealRehab job = new TSPC.CPSJob_DealRehab(templateIds, null, null);

job.scSyncFields = true;

job.pbSyncFields = true;

job.debugToEmails = new string[]{'anna.madajova@people.ai'};

Id jobId = DataBase.executeBatch(job, 10);

 

You will find the Id of the template/version on the template detail page.

Click “Copy” and paste the new value into the script in the place of a0O1U000004wd69UAA

Id[] templateIds = new Id[]{'a0O1U000004wd69UAA'};

Example

Id[] templateIds = new Id[]{'a0S4W00000ZqX1nUAF'};

Replace the email with your email 

job.debugToEmails = new string[]{'anna.madajova@people.ai'};

Example

job.debugToEmails = new string[]{'customer.email@customername.com'};

Your finished script should look similar to this: 

Id[] templateIds = new Id[]{'a0S4W00000ZqX1nUAF'};

TSPC.CPSJob_DealRehab job = new TSPC.CPSJob_DealRehab(templateIds, null, null);

job.scSyncFields = true;

job.pbSyncFields = true;

job.debugToEmails = new string[]{'customer.email@customername.com'};

Id jobId = DataBase.executeBatch(job, 10);

Copy and paste your modified script into the box.

Click Execute.

Modify and run the script for every Template/version you synced for the report.

Refresh the Report page to see the updated values.