0

I am trying to migrate my team to scratch orgs from individual dev sandboxes. The final barrier seems to be the fact that we're using the AccountContactRelation object. Whenever I do a push to a scratch org the first error I get is:

Error    force-app\main\default\objects\AccountContactRelation\AccountContactRelation.object-meta.xml      Invalid fullName, must end in a custom suffix ( for ex. __c )

I also get errors like:

Error    force-app\main\default\classes\AccountContact_RelationTriggerHandler.cls                   Invalid type: AccountContactRelation (14:13)

So the object clearly is not in the org. Below is my project-scratch-def.json file.

{
  "orgName": "Lazard Scratch",
  "sourceOrg": "00D1N000001i9f2UAA",
  "features": [
    "AuthorApex",
    "ContactsToMultipleAccounts",
    "DevelopmentWave",
    "FieldAuditTrail",
    "Interaction",
    "MultiCurrency",
    "ProcessBuilder",
    "StateAndCountryPicklist",
    "Workflow",
    "WorkflowFlowActionFeature"
  ],
  "settings": {
    "accountSettings": {
      "enableRelateContactToMultipleAccounts": true
    },
    "activitiesSettings": {
      "allowUsersToRelateMultipleContactsToTasksAndEvents":true
    },
    "entitlementSettings": {
      "enableEntitlements": true
    },
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "languageSettings": {
      "enableTranslationWorkbench":  true,
      "enableEndUserLanguages": true
    },
    "mobileSettings": {
      "enableS1EncryptedStoragePref2": false
    },
    "nameSettings":{
      "enableMiddleName": true,
      "enableNameSuffix": true
    },
    "quoteSettings": {
      "enableQuote": true
    },
    "territory2Settings": {
      "enableTerritoryManagement2": true
    }
  }
}

Can anyone tell me what I should be doing differently to allow this object to deploy?

5
  • Does this post answer your question- salesforce.stackexchange.com/questions/296952/… Feb 25, 2021 at 19:42
  • That might have something to do with it. The VSC extension seems to be hiding the error Warning: If you're using Contacts to Multiple Accounts, beginning with the Spring ’21 release, the feature isn't automatically enabled. You must manually enable the setting for new scratch orgs. Enable the setting in one of these ways: update the Account Settings page in Setup, add the enableRelateContactsToMultipleAccounts setting to your scratch org definition file, or enable it via Metadata API. when deploying, but I see it when I type the command myself. I'm trying again now but getting timeouts. Feb 25, 2021 at 20:27
  • 1
    This resolves my error with deploying the AccountContactRelation so thanks very much for that. However I still get other errors related to that object, for example Error force-app\main\default\flexipages\UltimateParentConsultant.flexipage-meta.xml Component [force:relatedListSingleContainer] attribute [relatedListApiName]: Could not find related list [AccountContactRelations] for entity [Account] Feb 26, 2021 at 14:54
  • I've also verified that the feature for Allow users to relate a contact to multiple accounts has been enabled in the scratch org, but now I can't see the AccountContactRelation object in object manager so the build still fails. Feb 26, 2021 at 20:21
  • I have been facing the same issue. Going to the org and manually disabling it and enabling it again fixes the issue, but it's not a great workaround. I have posted something that is related to this issue: salesforce.stackexchange.com/questions/388128/… Oct 25, 2022 at 8:55

1 Answer 1

1

I think this is linked to a Known Issue (two actually, but I assume the root cause is the same) where the AccountContactRelation feature is randomly not activated on Scratch Orgs:

You must log in to answer this question.

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