0

I am implementing Salesforce MetadataAPI , i created the custom fields using Metadata API but those fields are not visible , so how to set fieldlevel visibilty to all custom fields using Metadata API

  • field visibility is defined on Profile, Permission Sets level. SO you have update it via metadata api accordingly on profile or permission set level – Oleksandr Berehovskyi Oct 23 at 9:54
  • @OleksandrBerehovskyi Thank You. it works fine but what about if i have multiple users, does it mean i have to update the permission of custom fields for all users. – Shahid bhat Oct 27 at 2:57
0

You need to set these permissions in the Profile object. They are called fieldPermissions, which states if each field is readable, editable, and the name of the field:

<fieldPermission>
  <editable>true</editable>
  <readable>true</editable>
  <field>Account.CustomField__c</field>
</fieldPermission>

You may want to start by retrieving a Profile to see how this operates. The package.xml might look like:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
  <types>
    <members>*</members>
    <name>Profile</name>
  </types>
  <types>
    <members>*</members>
    <members>Account</members>
    <members>Contact</members>
    <name>CustomObject</name>
  </types>
  <version>47.0</version>
</Package>

Make sure you include all standard objects in the CustomObject element that you wish to retrieve field permissions for.

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.