3

Custom object Foo__c has master-detail relationship with object Account through field Account__c.

Custom object Foo__c also has master-detail relationship with object Contact through field Contact__c.

Fields Foo__c.Account__c and Foo__c.Contact__c both exist in destination org and destination org is on Summer '20 Patch 7

I updated account layout in source org to display object Foo__c related list as below and deploying to destination org:

Account-Account - Admin.layout:

<relatedLists>
    <fields>NAME</fields>
    <fields>Contact__c</fields>
    <relatedList>Foo__c.Account__c</relatedList>
</relatedLists>

When deploying this layout using the command sfdx force:source:deploy, running into error:

Invalid field:Contact__c in related list:Foo__c.Account__c

I even added fields Foo__c.Account__c and Foo__c.Contact__c to deployment package but still running into the error.

Deploying user has access to all the fields and objects involved and I double checked API names as well.

There are similar questions on this site but those issues are referring to Activities, AccountContactRelation which have some special properties and doesn't apply to my situation.

8
  • 1
    double-check the api names as well as permissions once again. Jun 3 '20 at 3:23
  • @MohithShrivastava I confirm API names and permissions look correct. I double checked.
    – javanoob
    Jun 3 '20 at 3:52
  • what tool are you using to deploying this ? Jun 3 '20 at 3:55
  • 1
    I suggest use workbench to isolate if this issue is due specific to force:source:deploy. If have the zip file just use the workbench deploy utility. Jun 3 '20 at 4:09
  • 1
    @Swetha In my situation, what happened was someone changed the relationship type from Master-Detail to Lookup in destination org but in my org it was Master-Detail. I updated the relationship type to Lookup in my org and retrieved the layout and was able to push it. I suggest checking if relationship type changed.. Hope this was helpful.
    – javanoob
    Sep 23 at 15:47

Your Answer

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

Browse other questions tagged or ask your own question.