7

When I attempt to push a custom profile to my scratch org that contains a layoutAssignment to the AccountContactRelation object, I get the following error:

In field: field - no CustomObject named AccountContactRelation found

From what I can tell of the documentation about the object, this may be in relation to PersonAccounts feature (which I see listed in the Scratch Org Definition documentation. But from what I see here, it would seem there should be some "Shared Contacts" or "Financial Cloud" feature:

AccountContactRelation is a standard object that is available through the Shared Contacts feature. Custom fields extend the AccountContactRelation standard object for use in Financial Services Cloud.

Am I correct to assume the fix here is adjustment to the scratch org definition file? And if so what is the appropriate modification?

Note: It would seem beneficial for Salesforce to produce some documentation about the features and preferences listed, for many, their only mention on the internet as a whole is from this single bulleted listed they've provided

Update: Workaround

If I go to Account Settings in the scratch org and manually turn on "Contacts to Multiple Accounts Settings" this seems to resolve the issue but this is a horrible solution.

enter image description here

2
  • 1
    Very much doubt Person Accounts is what you are after - that's a very different feature. You are right - it is typically referred to as Shared Contacts or something similar - but let me see if the Twitter world can shed some light – BritishBoyinDC Feb 2 '18 at 0:51
  • It might be possible to pull down the Account Settings entity with the Metadata API, archive it, and script a deploy of that object to your newly created scratch orgs to automate this. I'm not sure if that setting is in the MDAPI or not. – David Reed Mar 14 '18 at 22:15
3

it's old question, but in summer19 released a new feature called --"features":["ContactsToMultipleAccounts"], we r using same feature for "Contacts to Multiple Accounts Settings"

2

Current they best solution for this at this time is using the OrgSource Pilot program. Obviously it still has some work but it's definitely a lot easier to work with then not having it. First step is to request and gain access to it. Once you run a quick test with the pilot org they provide you then you can request to have your production org enabled with the feature.

The steps are pretty easy. Essentially you need to create a shape (this is essentially what a definition file is, but this is being generated by your given org).

sfdx force:org:shape:create -u Production

Then once that completes you can see it in your list like so:

sfdx force:org:shape:list

enter image description here

Once this is complete you can create a scrath org definition json using the source org id of your shape:

{
    "orgName": "My Company",
    "sourceOrg": "00D1N000001Bn#####",
    "hasSampleData": false
}

Then create a new scratch org using this definition file:

sfdx force:org:create -f ./config/production-scratch-def.json -d 30 -s -a test

That's it. Doesn't solve every problem yet but it does solve some. I noticed right away that this still doesn't account for things like Forecasting... (at least it didn't at the time).

0

Edit:

So, this seems one of some features that you can enable from inside the org, but not in the scratch org def. file. If I remember correctly, there were some features like this one that don't have (yet?) a parameter to be passed in the configuration file.


Check out the documentation for Scratch Org Definition Configuration Values.

It states that your functionality is available as PersonAccounts, from what I can see:

You can specify multiple feature values in a comma-delimited list in the scratch org definition file (for example):

"features": ["MultiCurrency", "AuthorApex"],

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.