6

I would like to retrieve custom fields with field level security using package.xml. How to prepare package.xml for this?

Thanks, Anil Kumar

1 Answer 1

7

You have to specify the profiles to retrieve the security for, as well as the object/fields. For example:

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

This should give you all permissions for all custom fields for all profiles. You can use CustomObject entries as well if you want object-level security settings. Note: CustomObject requires you to manually specify standard objects (e.g. Account, Case) to get those objects, instead of just using the wildcard.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .