Friday 6 July 2018


USER LICENSE AND PROFILES:

USER LICENSE 

You may have more than one type of user license in your organization. A user license entitles a user to different functionality within Salesforce and determines which profiles and permission sets are available to the user.


·         To view a list of the active user licenses in your company, from Setup, click Company Profile àCompany Information. This page lists the following for each type of user license:
·         Status indicates the status of the license.
·         Total Licenses indicates the number of licenses for which your company is billed and that are available to you.
·         Used Licenses is the number of licenses that you have assigned to users.
·         Remaining Licenses is the number of unused licenses.



PROFILE 

Represents a user profile. A profile defines a user's permission to perform different functions within Salesforce.
Every profile Must be associated with a License. This defines what the profile can do

you can retrieve and deploy access settings for the following managed components in profiles and permission sets:
·         Apex classes
·         Custom apps
·         Custom field permissions
·         Custom object permissions
·         Custom tab settings
·         External data sources
·         Record types
·         Visualforce pages

                            PermissionSetAssignment:



  • Use the PermissionSetAssignment object to query permission set assignments to find out which permission sets are assigned to which users.
  • Each user may be assigned to many permission sets and each permission set may be assigned to many users.
  • Each PermissionSetAssignment ID represents the association of a single user and single permission set.

For example, to search for all of the permission sets assigned to a particular user:

SELECT Id, PermissionSetId
FROM PermissionSetAssignment
WHERE AssigneeId = '005600000017cKt'

To search for all users assigned to a particular permission set:

SELECT Id, AssigneeId
FROM PermissionSetAssignment
WHERE PermissionSetId = '0PS30000000000e'

Note:

You can also create a new permission set assignment, or use delete to remove a permission set that's assigned to a user. To update an assignment, delete an existing assignment and insert a new one.

Possible Errors:



Solution:

When assigning a permission set, if the PermissionSet ​ has a UserLicenseId, its UserLicenseId and the Profile ​UserLicenseId must match.


If Permission set is already present for user.Following Error will occur.