2

I'm trying to retrieve XML profiles files, but the files I'm retrieving don't contain all object I listed in package.xml (especially Standard Objects). In the package.xml file I listed some standard objects:

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

I assume, that after the retrieving there should be a section <objectPermission> in every profile file containing the listed objects, something like this:

<objectPermissions>
    <allowCreate>true</allowCreate>
    <allowDelete>true</allowDelete>
    <allowEdit>true</allowEdit>
    <allowRead>true</allowRead>
    <modifyAllRecords>false</modifyAllRecords>
    <object>Account</object>
    <viewAllRecords>false</viewAllRecords>
</objectPermissions>

But not in all files I have this section. I have profile files which don't contain any of listed objects and I have some files which contain the listed objects, but not all of them (for example - object permission only for Account and Contact). Did anybody have this type of issue? How to "force" Salesforce and Visual Studio Code to retrieve the listed objects?

1 Answer 1

1

Profiles may be restricted by License Type. You can never retrieve permissions for objects restricted by the licence type. There's no way to force the system to expose these values, because they would be useless to the license type for that profile. If you don't see an entry for a given object, you could assume that the profile's license doesn't allow that type. You can also check the documentation for a given license type to verify.

3
  • Each profile has the "Salesforce" license, so I think the profiles have access to standard objects. Actually when I go to Setup -> Profiles -> Profile Name -> Object Permissions I can see the permissions for Account, Contact, Opportunity... I just can't retrieve them using IDE.
    – buarzi
    Commented Apr 29, 2020 at 17:18
  • @buarzi I think also if they have "no" permission it is excluded? I'm not sure there's a way to force that.
    – sfdcfox
    Commented Apr 29, 2020 at 17:51
  • You're right. No Access = No entry in XML file. An extra question: I have the same issue with Tabs visibility. I can only retrieve custom tabs. When I try to retrieve standard tabs I have an error: "Cannot retrieve a standard tab".
    – buarzi
    Commented Apr 29, 2020 at 18:49

You must log in to answer this question.

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