0

How to retrieve Field Level Security of a custom field in a certain profile in Opportunity object using manifest package.xml?

Searched the net and come up with the manifest xml to retrieve the Field Level Security of a custom field in a certain profile. However, this one is not accepted because of ~ and &

 <?xml version="1.0" encoding="UTF-8"?>
 <Package xmlns="http://soap.sforce.com/2006/04/metadata">
     <types><members>*</members>
       <name>Opportunity.My_CustomField__c</name> 
     </types>
     <types><members>*</members><name>~This is the my custom profile & custom 
      profile for Rep</name></types>
      <version>48.0</version>
 </Package>

So I changed it as I was seeing in VS Code, here it is below but I cannot retrieve the Field Level Security, Please let me know how to do it. Thanks.

   <?xml version="1.0" encoding="UTF-8"?>
   <Package xmlns="http://soap.sforce.com/2006/04/metadata">
        <types><members>*</members>
           <name>Opportunity.My_CustomField__c</name> 
        </types>
        <types><members>*</members>
            <name>%7This is the my custom profile %26 
           custom profile for Rep</name></types>
        <version>48.0</version>
     </Package>
0

You can find the correct format/syntax of the package.xml manifest for Profile retrieval in the Metadata API documentation here, in the Usage section. Then you can use Workbench (a quasi-official Salesforce tool) to determine the fullName of various metadata components to use in packages. The result in your case is the following:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
   <types>
        <members>Opportunity.My_CustomField__c</members>
        <name>CustomField</name>
   </types>
   <types>
        <members>%7EThis is the my custom profile %26 custom profile for Rep</members>
        <name>Profile</name>
   </types>
   <version>48.0</version>
</Package>
| improve this answer | |

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.