After deploying using ANT, Force.com IDE (now Salesforce Extensions for VS Code), Workbench, or any Metadata API-based tool, you may find that Page Layout Assignments on certain profiles and record type combinations are removed and shown as "Not Assigned" in Setup.
This happens because Page Layout Assignments in Salesforce are stored as <layoutAssignments> tags inside Profile metadata files. When Profiles are retrieved without also retrieving the associated Record Types and Page Layouts in the same transaction, these tags are absent from the retrieved Profile XML. Deploying a Profile without <layoutAssignments> tags instructs Salesforce to clear all page layout assignments for that profile.
Page Layout Assignments are controlled by <layoutAssignments> elements in Profile metadata files. Each assignment consists of:
<layout> tag specifying the page layout in the format: ObjectName-LayoutName<recordType> tag specifying the record type in the format: ObjectName.RecordTypeNameIf a Profile file is deployed without these tags, Salesforce interprets this as "remove all existing page layout assignments" for that profile, resulting in "Not Assigned" entries.
To preserve Page Layout Assignments during deployment, always retrieve the following three components in a single transaction from the source org:
<layoutAssignments> tagsWhen all three are retrieved together, the Profile XML will include <layoutAssignments> entries like the following example:
<layoutAssignments><layout>Opportunity-OpportunityLayout</layout><recordType>Opportunity.StandardRecordType</recordType></layoutAssignments>
In this example:
Opportunity-OpportunityLayout is the name of the page layout (ObjectName-LayoutName format)Opportunity.StandardRecordType is the API name of the record type (ObjectName.RecordTypeName format)The presence of these <layoutAssignments> tags in the Profile file tells Salesforce which page layout to assign to which record type during deployment.
If Page Layout Assignments are removed after a deployment and the <layoutAssignments> tags were not present in the Profile file, this is expected (Working As Designed) behavior. The Salesforce Metadata API deploys exactly what is contained in the deployment payload. If the layout assignment tags are absent from the Profile, Salesforce clears those assignments. There is no defect — the solution is to always retrieve all three components together.
000382756

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.