Press enter to see results or esc to cancel.

How to enable Allow Users to Relate Multiple Contacts to Tasks and Events (SharedActivities) during scratch org creation

In this blog post we will see how to enable Allow Users to Relate Multiple Contacts to Tasks and Events setting while creating the scratch org.

update the project-scratch-def.json file as below

{
  "orgName": "Demo company",
  "edition": "Developer",
  "features": [
    "EnableSetPasswordInApi",
    "SharedActivities"
  ],
  "settings": {
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "mobileSettings": {
      "enableS1EncryptedStoragePref2": false
    }
  }
}
We need to include SharedActivities feature in the definition file in order to enable Allow users to relate multiple contacts to events and tasks setting under Activity settings.
Once you have updated the definition file execute the default scratch org creation command from project folder.
sfdx force:org:create -f config\project-scratch-def.json --setalias sharedActivities --durationdays 1 --setdefaultusername --json --loglevel fatal
Once the scratch org created open the scratch org and you will observe the Allow users to relate multiple contacts to events and tasks setting under Activity settings enabled.
SharedActivities
Please go through the documentation (Considerations for enabling Shared Activities) before enabling the setting as we can’t disable and we might need to contact Salesforce to disable this feature.


Reference: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file_config_values.htm#so_sharedactivities