1

I had created custom fields using metadata api,but field is not visible because of FieldLevelSecurity is false,i can make fieldLevelSecurity true using apex for System Admin.thanks in advance

MetadataService.AsyncResult[] asyncResults = service.create(new List<MetadataService.Metadata> {
                        customField
                        });

Like above I am inserting.  

1

You can make the field level security by metadata API. When you create the field. Also send the field level permission in Admin Profile type metadata. A sample field permission looks like below.

<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
  <fieldPermissions>
        <editable>true</editable>
        <field>ObjectName__c.Field__c</field>
        <readable>true</readable>
    </fieldPermissions>
</Profile>
0

From the Salesforce: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_profile.htm ProfileFieldLevelSecurity represents the field level security for users assigned to a profile. In API version 30.0 and later, permissions for required fields can’t be retrieved or deployed.

  • I just found this tool that it is really cool and useful. read the article or search for"Easing the Burden of Bulk Field Level Security Updates in Salesforce" nathanfranklin.com.au/salesforce/… – msantana Sep 14 '17 at 18:46

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.