Explanation of the issue with "ViewAllFields" changes
Staring with API v63 Salesforce introduced <ViewAllFields>
permissions for Custom objects.
When deployed, this field will give "view" permissions to all fields in an object.
With the way <ViewAllFields>
changes are currently being handled by the Metadata API, this change will not be deployed unless you also include at least one other field change in the deployment.
Example
If you are planning to deploy the following in one of your permission sets to grant viewAllFields = true.
<objectPermissions>
<object>Account</object>
<viewAllFields>true</viewAllFields>
</objectPermissions>
You would also need to include one of the fields from the account object.
<fieldPermissions>
<editable>true</editable>
<field>Account.AccountNumber</field>
<readable>true</readable>
</fieldPermissions>
If you do not include one of the fields, the deployment will be successful but the change will not reflect in the target org.
Salesforce has not yet confirmed if this is a bug or intended behaviour.
Unfortunately, when you retrieve the ViewAllFields
change from Salesforce, it will not retrieve the fields being shown as readable = true.
This means that the above fix does not work in Gearset unless you manually make the changes in a deployment package file in your Version Control System (e.g. GitHub, Azure DevOps, Bitbucket etc).
Solution
Gearset is currently testing an automatic solution to help deploying <ViewAllFields>
changes via our app.
This solution works in most cases but has not been released publicly yet as there are still a few scenarios where the change will not deploy. Once these are ironed out we will make this available for all users.
In the meantime, if you’d like early access and are happy to accept that it may not work in every scenario, just reach out via our in-app chat and we will apply the fix to your account.