WHERE ARE THE KIDS?

INSTRUCTION MANUAL

Daisy Sayre

Founder, ImagineCRM

Salesforce Nonprofit, HigherEd, and Foundation Implementations

@daisysayre and @Imagine_CRM

Laura Derby

Salesforce Admin at TreePeople & User Group Leader for

Salesforce Environmental Nonprofit User and LA Nonprofit User Groups

@12345laurad


STEP 1: SIGN UP FOR A TRIAL DEVELOPER ORG https://developer.salesforce.com/signup

STEP 2: CREATE FIELDS TO ENHANCE CAMPAIGN REPORT

Create a custom Campaign IDs text field

  1. Select Setup (upper right-hand corner)

  1. Search for Object Manager by typing it in the Search box and clicking Object Manager

  1. Select Campaign, then Fields & Relationships
  2. Select the New Button

  1. Select Text, then the Next button.
  2. In Field Label, type Child Campaign IDs
  3. Make the Length 255, then select the Next button.

  1. Make it visible only to System Administrators, then select the Next button.
  2. Select the Save button.

Once a Process is created for it through Lightning Process Builder, this field will get populated with the all its related (Child) Campaign IDs.

Create a custom formula Campaign IDs field

This field will concatenate the Child Campaign ID’s with the existing record ID.

  1. Select Setup (upper right hand corner)

  1. Search for Object Manager by typing it in the Search box and selecting Object Manager

  1. Select Campaign, then Fields & Relationships
  2. Select the New Button

  1. Select Formula, then the Next button.
  2. In Field Label, type Campaign IDs
  3. Select Text for the Formula Return Type, then select the Next button.
  4. Select the Advanced Formula Tab
  5. Use the following formula:

IF(Child_Campaign_IDs__c != null, Id & ',' & Child_Campaign_IDs__c, Id)

  1.  Select Next
  2. Make it visible only to System Administrators, then select the Next button.
  3. Select the Save button.

STEP 2: CREATE A ROLLUP PROCESS WITH PROCESS BUILDER

  1. Select Setup, then enter process builder into the search bar.
  2. Select Process Builder

  1. Select the New button (upper right-hand corner)
  2. For Process Name type Campaign | Parent Campaign Rollup
  3. For The process starts when, choose A record changes.
  4. Select the Save button.

  1. Selet Add Object

  1. Next to Object, choose Campaign
  2. Next to Start the process, choose when a record is created or edited.
  3. Select the Save button
  4. Select Add Criteria

  1. Next to Criteria Name, enter Campaign Ids Updated
  2. Next to Criteria for Executing Actions, choose Formula evaluates to true
  3. Under Build Formula, enter the following formula:

ISCHANGED([Campaign].Child_Campaign_IDs__c ) && [Campaign].ParentId != null

  1. Select the Save button.

  1. Select Add Action (under Immediate Actions)

  1.  For the Action Type, choose Update Records
  2.  For Action Name, enter Roll Up Child Ids
  3.  Under Record Type, for Select a Record to Update, choose Select a record related to the Campaign, then choose:

Parent Campaign ID (do not choose Parent Campaign ID>) and select the Choose button.

  1. For Criteria for updating your records, choose No criteria—just update the records!
  2. For Set new field values for the records you update, under Field, choose: Child Campaign IDs
  3. For Type choose Formula
  4. Enter the following formula:

IF([Campaign].Parent.Child_Campaign_IDs__c  != null,  [Campaign].Child_Campaign_IDs__c & ',' & [Campaign].Parent.Child_Campaign_IDs__c ,[Campaign].Id & ',' & [Campaign].Child_Campaign_IDs__c)  

  1. Select the Use this Formula button

  1. Select the Save button
  2. Select Evaluate the next Criteria and click the Save button

STEP 4: CREATE ANOTHER CRITERIA WITHIN THE SAME PROCESS BUILDER

This process will bring in all the child Campaign Id’s when campaign hierarchy is established.

  1. Select Add Criteria

  1. For Criteria Name, enter Check Campaign Parent Id
  2. For Criteria for Executing Actions, choose Formula evaluates to true
  3. Under Build Formula, enter the following formula:

((ISNEW() && [Campaign].ParentId != null ) || (ISCHANGED([Campaign].ParentId) && PRIORVALUE([Campaign].ParentId) == null   && [Campaign].ParentId != null))

  1. Select the Save button
  2. Select Add Action (under Immediate Actions)

  1.  For the Action Type, choose Update Records
  2.  For Action Name, enter Update Child Campaign Ids
  3.  Under Record Type, for Select a Record to Update, choose Select a record related to the Campaign, then choose:

Parent Campaign ID (do not choose Parent Campaign ID>) and select the Choose button.

  1. For Criteria for updating your records, choose No criteria—just update the records!
  2. For Set new field values for the records you update, under Field, choose: Child Campaign IDs
  3. For Type choose Formula
  4. Enter the following formula:

(IF(ISBLANK([Campaign].Parent.Child_Campaign_IDs__c), [Campaign].Id ,  [Campaign].Parent.Child_Campaign_IDs__c & ',' & [Campaign].Id))

  1. Select the Use this Formula button

  1. Select the Save button
  2. Select the Activate button (upper right-hand corner)

STEP 5: ADD A VALIDATION RULE TO PREVENT PARENT CAMPAIGN FROM BEING CHANGED

One caveat to setting up these processes is that the parent campaigns cannot be changed or the roll up process will get corrupted. A validation rule ensures that this will not occur.

  1. Select Setup (upper right-hand corner)
  2. Search for Object Manager by typing it in the Search box and clicking Object Manager
  3. Select Campaign, then Validation Rules
  4. Select the New button.
  5. For Rule Name, enter ParentValidation
  6. Select the Active checkbox
  7. Enter the following formula in the Error Condition Formula section:

PRIORVALUE(ParentId) != null && ISCHANGED(ParentId)

  1. For error message, enter Unable to change Parent campaign. Please contact your System Administrator.
  2. Select the Save button

STEP 6: CREATE A CAMPAIGNS WITH OPPORTUNITIES REPORT

  1. Select the Reports tab and New Report to add a custom report
  2. Select the Report Type Campaigns with Opportunities

  1. Select Filters tab to update criteria

  1. Create the following Criteria

  1. Update the Columns  and Grouping displayed in your Report

  1. Click Save and run report

STEP 7: CREATE A CAMPAIGN WITH OPPORTUNITIES REPORT BUTTON AND UPDATE CAMPAIGN PAGE LAYOUT

  1. Capture the Report URL by clicking Reports tab and selecting the report you just created.

  1. Copy the Report URL

  1. Navigate to Campaign Object in Setup and select Buttons, Links, and Actions, and select New Button or Link

  1. Enter the settings required for a button and include the following link code and Save

<REPORT URL>?fv0={!Campaign.Campaign_IDs__c}

Example: https://cs20.lightning.force.com/lightning/r/Report/00Om0000000QilWEAS/view?fv0={!Campaign.Campaign_IDs__c}

  1. Update the Campaign Page Layout with the Custom Button

STEP 8: PREPARE TEST DATA AND CAMPAIGN HIERARCHY FOR TESTING IN SANDBOX

  1. You will create a few test Campaigns and name them:
  1. Go to the Campaigns tab and select the New button

2) In the Campaign Name field, enter Annual Tree Dedications 2018.

3) Leave the default Status and Type as is.

4) Make the Start Date and End Date today’s date.

5) Select the Save & New button.

6) In Campaign Name field, enter Mother's Day TD Parent Campaign 2018 

7) Follow previous steps 2-4.

8) Populate the Parent Campaign field as Annual Tree Dedications 2018.

9) Continue to create campaigns with the following Campaign Names, by following steps 2-4:

  1. Campaign Name: Mothers Day TD Direct Mail 2018; Parent Campaign Name:  Mother's Day TD Parent Campaign 2018
  1. Campaign Name: Mothers Day TD Donations ONLY 2018; Parent Campaign Name: Mothers Day TD Direct Mail 2018
  1. Campaign Name: Mothers Day TD Phoned In 2018; Parent Campaign Name: Mother's Day TD Parent Campaign 2018
  2. Campaign Name: Mothers Day TD Online Orders 2018; Parent Campaign Name: Mother's Day TD Parent Campaign 2018

10) Leave the Status and Type as is.

11) Make the State Date and End Date today’s date.
12) Then, select the
Save button.

STEP 9: CREATE TEST OPPORTUNITIES

  1. You will create a few test Opportunities and tie them to one of the Campaigns listed above.
  2. Go to the Opportunities tab, then select the New button and see the examples below.

STEP 10: USING YOUR TEST CAMPAIGN RECORDS, TEST THE PROCESSES YOU BUILT

  1. Click the Campaigns tab and Select the Top Level Campaign (highest in the hierarchy)

   2. Select the Campaign Opportunities Report button

   3. View Report

STEP 11: TOP LEVEL FORMULA FIELD

  1. Select Setup (upper right-hand corner)
  2. Search for Object Manager by entering it into the Search box and clicking Object Manager
  3. Select Campaign, then Fields & Relationships
  4. Select the New button
  5. For Data Type, choose Formula and select the Next button.
  6. For Field Label, enter Top Level Campaign
  7. For Formula Return Type, enter Text and select the Next button.
  8. For Formula Options, enter the following formula:

If(isblank(ParentId),Name,

if(isblank(Parent.ParentId),Parent.Name,

if(isblank(Parent.Parent.ParentId),Parent.Parent.Name,

if(isblank(Parent.Parent.Parent.ParentId),Parent.Parent.Parent.Name,NULL

))))

  1. Select the Next button
  2. Make the Field Level Security for Profile visible to all profiles by checking the Visible checkbox.
  3. Select Next.
  4. Select the Save button

You did it!

Thank you for following this workbook. Let us know if you have any questions or suggestions for how it can improve.