You need to sign in to do that
Don't have an account?

assigning permission set on newly created partner user
How do I assign a permission set on newly created partner user?
public class AssignPermissionSet { public static void assignperm(List<user> userlist){ Set<ID> usersId = new Set<Id>(); Set<Id> contactIdsSet = new Set<Id>(); List<PermissionSetAssignment> permissionSetList = new List<PermissionSetAssignment>(); for (User u : [Select Id, Name, ProfileId FROM User Where Id IN : userlist]){ // Add fields as per your requirement... if(u.ProfileId == '00e360003429432'){ PermissionSetAssignment psa = new PermissionSetAssignment (PermissionSetId = '0PS33609skjojsae', AssigneeId = u.Id); permissionSetList.add(psa); } } insert permissionSetList; } }
I assume that you are facing a problem in assigning permission set to Partner user.
While creating Permisison Set you will be selecting the type of users using the permission set. License will be selected from the drop down. Check whether your permissionSetId = '0PS33609skjojsae' has any license assigned to it. If yes then only those users can use the permisison set.
If you want every user irrespective of the license then choose none.
Please check the following post for reference
https://success.salesforce.com/answers?id=9063A0000019RJgQAM
Regards
Karthik
All Answers
I assume that you are facing a problem in assigning permission set to Partner user.
While creating Permisison Set you will be selecting the type of users using the permission set. License will be selected from the drop down. Check whether your permissionSetId = '0PS33609skjojsae' has any license assigned to it. If yes then only those users can use the permisison set.
If you want every user irrespective of the license then choose none.
Please check the following post for reference
https://success.salesforce.com/answers?id=9063A0000019RJgQAM
Regards
Karthik