FLS not committed for some specific fields.

When moving profiles or permission sets, using either a normal commit or a full profile and permission sets commit, you may notice that the FLS of some fields is not committed into Git.

Whenever this happens, check if the field is required in the source org from where you are committing. If the field is set as required in the field definition, the FLS will not be retrieved by the Metadata API, and therefore it will not be committed. This is the standard behavior as of Metadata API version 30. Please refer to page 339 of the Salesforce document below:

http://resources.docs.salesforce.com/188/latest/en-us/sfdc/pdf/salesforce_spring14_release_notes.pdf


User-added image

If the field is required in the destination org, the FLS will be already updated in the permission sets and the profiles, as this happens automatically as soon as the field is set as required. If the field is not required in the destination org, you will need to move the field so that the attribute is updated in the target org and the FLS is updated automatically in the profiles and permissions sets.

How did we do?