1

Salesforce's documentation states that you can install FSL (and activate related objects, such as Work Order) using the scratch org definition file:

{
    ...
    "features": ["FieldService"],
    ...
}

But when I create a new scratch org, it isn't enabled by default. I have to manually log in and search for the FSL settings to enable it.

Is this intended behavior, or do I have to specify some other thing in the org definition file to get it enabled by default?

2
  • 2
    FieldServiceSettings is available via Metadata API and thence also in the settings portion of the SFDX config - I suspect you need to set fieldServiceOrgPref to true to actually activate the feature, while the features entry just makes it available.
    – David Reed
    Commented Aug 27, 2019 at 20:07
  • 1
    @DavidReed is correct (and should add his comment as an answer), you should have the following: { "features": ["FieldService"], "settings": { "fieldServiceSettings": { "fieldServiceOrgPref": true } } }
    – Kyle
    Commented Dec 4, 2019 at 19:57

1 Answer 1

2

I think you should indicate the number of licenses you want to emulate by adding an integer (e.g. FieldService:2) as shown in my "features" array below. Also note the block of "fieldServiceSettings" too

{
  "orgName": "Core Scratch",
  "sourceOrg": "<< MY SHAPE ID >>", 
  "features": ["FieldService:2","Communities","Sites","MarketingUser","ServiceCloud","SalesUser","ServiceUser","ContactsToMultipleAccounts"],
  "description":"Customizations for Accounts, Leads, Contacts, Location, Opportunity with custom Territory Mgt. and Field Services",
  "adminEmail": "[email protected]",
  "settings": 
  {
    "fieldServiceSettings": { 
      "fieldServiceOrgPref": true ,
      "doesShareSaWithAr":true,
      "serviceAppointmentsDueDateOffsetOrgValue":7,
      "enableWorkOrders":true
    },
    "accountSettings": {
      "enableRelateContactToMultipleAccounts": true
    },
    "emailIntegrationSettings":{
      "enableContactAndEventSync": true,
      "enableProductivityFeatures": true,
      "doesGmailStayConnectedToSalesforce": true,
      "enableOutlookIntegration": true,
      "enableGmailIntegration": true,
      "isLayoutCustomizationAllowed": true,
      "doesEmailLogAsEmailMessageInOutlook": false,
      "shouldUseTrustedDomainsList": false,
      "enableEmailTrackingInMobile": true,
      "enableSupplementalContactInfoInMobile": false,
      "enableEngageForOutlook": true
    },
    "lightningExperienceSettings": {
        "enableS1DesktopEnabled": true
    },
    "mobileSettings": {
        "enableS1EncryptedStoragePref2": false
    },
    "pathAssistantSettings": {
        "pathAssistantEnabled": true
    },
    "chatterSettings": {
      "enableChatter":true
    },
    "apexSettings": {
        "enableCompileOnDeploy": false
    }
  }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .