3

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?

3 Answers 3

6

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>

Removing license

N.B. remove the <license>...</license> line if you want the PS to be assignable to multiple License types. Doing <license></license> will not save. Thanks @cropredy.

2
  • 1
    N.B. remove the <license>...</license> line if you want the PS to be assignable to multiple License types. Doing <license></license> will not save.
    – cropredy
    Nov 29, 2023 at 23:19
  • 1
    @cropredy Yeah, I forgot that scenario, now added that to my answer. Nov 30, 2023 at 19:03
0

In case you want to keep the same "Name" and "Label" for a Permission Set and avoid the deployment error: "License can't be updated" you can do the following (base on the Rahul Gawale answer):

  1. Find the meta XML file for the permission set (in the permissionsets folder) copy and save it locally on your computer.
  2. Delete the permission set from org (it also should be removed from the permissionsets folder once you do the retrieve)
  3. Add/modify the license tag () in the locally saved permission set.
  4. Add the modified meta XML file to the permissionsets folder and deploy it (with VS Code).
  5. Remove the old permission set from the target org (pre deploy step).
  6. Deploy the changes to the target org.
-1

User License assigned to a permission set can’t be modified after the permission set is created. Please check the below link for more information https://help.salesforce.com/s/articleView?id=000332257&type=1

1

You must log in to answer this question.

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