ClosePlan Package licensing uses a site-wide configuration for all Subscribers instead of a per-seat configuration. This means, technically, that every user has access to the package.
Site-wide configuration overcomes Salesforce licensing issues inherent in Lightning Experience which are yet to be solved.
Instead of full site-wide licensing, ClosePlan uses internal Licensing to provide Users with access to ClosePlan modules. Previously, access was driven through permission sets, which worked well and Customers started to provision users automatically without a need to manually find and provision using the User Manager. However in either a manual or automated approach, ClosePlan would not be able to enforce any license limits based on what has been contracted.
As a result, the ClosePlan User Manager is used. The User Manager controls and provides visibility into provisioned Users within the subscriber's organization over time. As a result, automated provisioning has been removed because subscribers cannot access or manipulate license data.
To automate User Provisioning, we provide APEX APIs.
Apex Invocable
Flows / Process Builder Invocable
Bulkified
ClosePlan Package/User License not required for running User
Only Users with ManageProfilesPermissionsets
or AssignPermissionSets
permission will be able to successfully invoke APIs to assign/modify user license.
User Management APIs provide the ability to retrieve user license information or assign or change user licensing using the scopes
API methods are provided through global TSPC.CPUserManagement
class.
Following methods allow accessing User ClosePlan license information through APEX
global static UserLicense getUserLicense()
global static UserLicense getUserLicense(Id userId)
TSPC.CPUserManagement.UserLicense
Property | Type | Description |
---|---|---|
| ID | Readonly; |
| string | Readonly; |
| string | Readonly; |
| string | Readonly; |
| string | Readonly; |
| string | Readonly; |
| string | Readonly; |
|
| Readonly; True if at-least one module has at-least read access |
Following methods allow to modify user ClosePlan license through APEX, Flows or Process Builder.
API methods to modify ClosePlan user licenses can be invoked only in the context of the user who has “Manage Profiles and Permission Set“ or “Assign Permission Sets” permission granted. For instance, invoking API methods as a result of user profile update by the user without sufficient permissions would be canceled. |
In order to assign users with ClosePlan licenses, the organization must have spare licenses of the given type available. In case licenses are depleted, the allocation will be canceled without any warning for the whole batch. |
Users who have been suspended will be automatically skipped. If you want to change the license for these users, use ClosePlan User Manager. |
global static void setUserLicense(UserLicenseRequest[] requests)
Property | Type | Description |
---|---|---|
| UserLicenseRequest[] | List of UserLicenseRequest objects |
TSPC.CPUserManagement.UserLicenseRequest
Property | Type | Description |
---|---|---|
| User |
|
| string |
|
Scopes refer to scope type followed by the modifier class. Types can represent the app or module they grant access to or additional access modifier.
The list of modules includes app-wide suite
or module-based deal
, and account
. There are only two classes of access:
read: read access to all the ClosePlan module data.
full: modifying data in any way e.g. creating, editing, or deleting.
Note that not every combination of suite
and module
accesses is valid as they can be mutually exclusive.
Additional types currently include only the level
with two classes available:
user: standard access for end-users. If level not specified, level:user
will be applied by default if not level not set yet (license create)
admin: elevated access, which grants read/write access to ClosePlan admin section
In order to remove/deactivate user, use remove
scope as an only value. Note that removal will be ignored if other scopes are added for the user at the same time.
level:admin
level:user
suite:full
suite:read
deal.playbook:full
deal.playbook:read
deal.scorecard:full
deal.scorecard:read
deal.relations:full
deal.relations:read
remove
// Get users based on user name or any other logic String[] userNames = new String[]{'user@yourorg.com'}; // User fields Id, UserType, IsActive are required User[] users = [SELECT Id, UserType, IsActive FROM User WHERE Username IN: userNames AND isActive=true]; // Build Licence Request List TSPC.CPUserManagement.UserLicenseRequest[] ulrs = new TSPC.CPUserManagement.UserLicenseRequest[]{}; for(User u : users){ TSPC.CPUserManagement.UserLicenseRequest ulr = new TSPC.CPUserManagement.UserLicenseRequest(); ulr.user = u;e // set scopes based on available scopes. // If level scope is ommited, new assignments will default to level:user while // already provisioned users will keep their current level. ulr.scopes = 'suite:full level:user'; ulrs.add(ulr); } // Execute TSPC.CPUserManagement.setUserLicense(ulrs); |
By default,
Service Cloud Users:
For CP Admin Users only: |
The following example shows how to create Flow to assign ClosePlan license automatically whenever new user is Created
Setup > Process Automation > Flows
Click New Flow
Select Record-Triggered Flow
Click Create
Click Object and select User
You can define any conditions you like
Although it's handled by the Service, you could add UserType equals Standard
, because only Standard Users are supported.
Or change the Condition Requirements list to None to execute every time
Click Done
Click Circle Plus sign to Add Element
Select Action
Search for ClosePlan: Set User License and select it
Use Assign ClosePlan License
as an action Label. API Name will be autofilled.
Populate the Scopes field based on the available scope list above according to your needs.
We will use suite:full
in our case to provide user with full suite access.
Populate User field with {!$Record}
. This value will be always the same.
Click Done
Click Save
fill Label (ie: 'ClosePlan: License assignment flow') and API Name
Click Save
Finally, click Activate