I have created a custom field for a Standard Object (Opportunity) using Metadata Api. And the field was created successfully. But when I try to edit or create a new opportunity, the custom field is not visible. I have searched for enabling field accessibility for all profiles and also to include the page layout but with no success. Can anyone send me a reference to set field accessibility for the fields created using metadata API programatically.

  • Did you check on the possibility of the page layout of this newly created custom field on Standard Object (Opportunity) along with the profile who is creating it?
    – orangeguy
    May 16, 2016 at 11:19
  • You can set field-level security for a single field on all profiles. To do that navigate to Setup -> Customize -> Opportunity -> Fields, click the field label, and then click the Set Field-Level Security button. Jul 2, 2016 at 15:46

2 Answers 2


To understand what is happening, when we deploy or create new metadata in Salesforce, we are just editing the XML files for that metadata type. In Salesforce, security is saved in its own XML, that is, profiles or permission sets. Therefore, when insert fields via the Metadata API you are just adding a field to that object's information, but, visibility is managed within a profile's own file.

With this in mind, you can understand that what happens when we check the visibility boxes in the field creation wizard or why a field doesn't have visibility when inserted via API.

If you want to give visibility to a certain field, one option is to deploy the profiles with that field information included or directly, go to the object > fields > Field Level Security in the setup after having created it. Make sure that you are system administrator to have complete visibility and privileges.


click here for more information, hope you have done this before. If you are logged in sys admin with filed access u should be able to see the field. OR else create record from code using developer console.

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.