Are you comparingĀ 

  • between a git branch to a Salesforce org, andĀ 
  • the Profile (or permission set) or profile permissions are showing up as New or Deleted despite you being certain that the Custom field permission or Apex class permission is in the org?

This article explains what is going on.

If you only use the Profile metadata type in the comparison filter, how the results are displayed differs depending on the environment type.

From an Salesforce org, this will retrieve nothing, as the org requires at least 2 metadata types to be able to retrieve any results. See this article for how you always need Profile plus another metadata type to show a result.

From a git branch, Gearset pulls the Profile from the git branch as a whole Profile and that will include the various subcomponent types.

So despite the Admin profile being in my source org, if I only use the Profile metadata type in the comparison filter, the Admin Profile will show up as Deleted.

To change this I can run the comparison with the Profile and the Custom Object metadata type to surface the profile from the org.

Therefore, the comparison results may show something as New or Deleted, not because it doesn't exist in your org, but because the metadata filter that you are using does not retrieve that Profile junction item.

All you need to do to correct that is to add in the additional metadata type (for example Custom Object or Apex Class) to make the comparison result show what you are looking for.

Did this answer your question?