I am getting the below error when I am trying to deploy a new profile:

You cannot deploy to a required field Object_Name__c.Field_Name__c.

I saw the solution posted here: Force.com IDE profile deployment - You cannot deploy to a required field Object_Name__c.Field_Name__c

But I have used an existing .profile file and I am trying to give read only access to all the fields and objects for an app.

There are a lot of objects and fields and hence not able to detect the required fields and remove them from the file.

Any solution for this? Any help is greatly appreciated.


"Since API version 30.0 a change set or ant deployment will fail if a field that is required in the field definition is included in a profile or permission set that is being deployed.

If you create a new custom field and check 'Required', Field Level Security automatically becomes 'Visible' for all profiles. Similarly, if you edit the definition of a custom field which is not visible to all profiles and check 'Required' then it automatically becomes visible to all profiles. Therefore there is no need to reference it in a permission set. Try it!"

It means, that you need to remove from profile metadata fieldPermissions of this field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.