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.
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
Comments
3 Comments
Are you sure this works? I have been attempting to get this to work for the better part of a year, and the feature always says it\’s enabled, but the checkbox next to the option is never checked in the scratch org…and the feature never works properly. We always have to use sandboxes to do any development that requires the use of the EventRelation or TaskRelation objects.
Thanks for the detail. I tried and it works as somewhat expected, but the name field doesn\’t display the other contacts involved in the Activity/task. its always like : Name: + 3 example. unlike attendee this is just a text \’+3\’ and doesn\’t show the rest of the contacts. We have to navigate to the related list to find out the contacts. this is not helping users as too many clicks. kindly suggest of any solution to this.
Thanks for the detail. I tried and it works as somewhat expected, but the name field doesn\’t display the other contacts involved in the Activity/task. its always like : Name: + 3 example. unlike attendee this is just a text \’+3\’ and doesn\’t show the rest of the contacts. We have to navigate to the related list to find out the contacts. this is not helping users as too many clicks. kindly suggest of any solution to this.
Leave a Comment