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.
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.