[SalesForce] Change/Update User License assigned to a permission set

I have created a Permission set using a Salesforce License type, now this permission set has to be assigned to community user as well which am unable to assign, so was thinking to update the license to be able to add community users.

Is there a way to change the User license type?

Best Answer

No, you can't change the license, but you can clone the permission set using vs code.

Get your existing permission using package.xml

<types>
    <members>*</members>
    <name>PermissionSet</name>
</types>

Now, follow the below process to clone the Permission Set.

  1. In the permission set folder, you will get the meta XML file for the permission set.
  2. Copy and paste the file in the same folder, change the name to the desired name of the cloned permission set.
  3. Change the label of the new permission set in the meta XML file.
  4. Change the License Name of the new permission set in the meta XML file.
  5. Now, deploy the new permission set.

See here is the example of meta XML file of the permission set, it contains all the settings.

<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
    <hasActivationRequired>false</hasActivationRequired>
    <label>------Add the desired label here-----</label>
    <license>------Add the desired license here-----</license>
    <userPermissions>
        <enabled>true</enabled>
        <name>ViewRoles</name>
    </userPermissions>
    <userPermissions>
        <enabled>true</enabled>
        <name>ViewSetup</name>
    </userPermissions>
</PermissionSet>
Related Topic