function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jhartjhart 

problem using metadata API in conjunction with "Person Account" Page Layout

I use the metadata API to download all of my page layouts:

$ perl md.pl -m retrieve -f test.zip Layout

(this command downloads all page layouts, and nothing else)

I then immediately re-upload test.zip using "deploy", not having edited it in any way:

$ perl md.pl -m deploy -f test.zip

This usually works, but in certain orgs it fails with an error like this:

Code:
<messages>
 <changed>false</changed>
 <created>false</created>
 <deleted>false</deleted>
 <fileName>unpackaged/layouts/Account-Person Account Layout.layout</fileName>
 <fullName>Account-Person Account Layout</fullName>
 <problem>Layout must contain an item for required layout field: ParentId</problem>
 <success>false</success>
</messages>

If I log in to the user interface, I don't even see this "Person Account Layout" listed in the Account Page Layout section.

It seems like there is a broken Page Layout "hiding" in the org, which is nonetheless downloaded via "retrieve", and then kills any "deploy" attempt.

Any insight would be greatly appreciated.  Looking at the page layout XML, there is nothing obviously wrong with it.

Best Answer chosen by Admin (Salesforce Developers) 
jhartjhart

Note to anyone interested - this bug has been fixed by now =)

All Answers

pmorellipmorelli
We've seen this bug internally. The org has B2I enabled, this is an artifact of how we implement it internally. We'll fix it soon.
hamayoun65hamayoun65
I have just come across a similar problem to this.  This was reported back in August, does anyone have a timeframe to when it might be fixed?
jhartjhart

Note to anyone interested - this bug has been fixed by now =)

This was selected as the best answer