Deployment · Salesforce

Retrive Profile/PermissionSet with object and field permission?

Profile Deployment – Right now small organization using ANT or Force.IDE tool for deployment. Many of them having issue to Objects and Fields level profile/PermissionSet permissions.

Current Problem: When you pull profile alone using ANT or Force.com IDE tool – you will be getting only User Level permissions not Object and Field level permission. Many have wrong understanding that below package.xml will give entire profile permission

<types>
    <members>Admin</members>
    <name>Profile</name>
</types>

Actually understanding is wrong. This will return only User level permissions.

Solution for All Object Permission: If you want to pull all objects and fields permission – you have to add CustomObject with your package.xml.

<types>
    <members>Admin</members>
    <name>Profile</name>
</types>
<types>
    <members>*</members>
    <name>CustomObject</name>
</types>

Note : Profile will have All User Level Permission and Account Object, Field, Tab and RecordType Level Permissions for that Profile.

Solution for Specific Object Field Permission: Need to add CustomField with your package.xml.

<types>
    <members>Admin</members>
    <name>Profile</name>
</types>
<types>
    <members>Account.AccountSource</members>
    <name>CustomField</name>
</types>

screen-shot-2016-10-12-at-4-58-02-pm

Note : Profile will have All User Level Permission and AccountSource Field Level Permission for that Profile.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s