If you deploy profile metadata using DevOps Center, Salesforce CLI deploy-retrieve library, Metadata API, or other tools, you can accidentally overwrite the profile due to how profiles are structured. To reduce the risk of overwriting or deleting profile contents, we recommend that you use permission sets instead.
The contents requested in the RetrieveRequest message determine the profile or permission set contents that the Metadata API returns. For example, profiles only include field-level security for fields included in custom objects returned in the same RetrieveRequest as the profiles. Likewise, when a profile is deployed, all of its permissions, custom objects, fields, and page layouts must be manually included; otherwise, they’re removed from the profile .xml file. This behavior can lead to issues where profiles are overwritten when deploying updates.
We recommend that you use permission sets instead of profiles to manage user access and permissions. While permission sets and profiles have the same behavior for retrieve and deploy calls, permission sets are in general more contained, which makes it easier to manage their included settings and permissions. Permission sets allow you to grant users only the permissions they need in a more granular, flexible manner than profiles. You can also bundle permission sets into permission set groups to streamline permission assignment and management.
Use permission sets to manage:
Use profiles to manage:
Note: You can add profiles to your project's .forceIgnore file so that they’re ignored when pulling changes.
See also:
000395615

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.