You need to sign in to do that
Don't have an account?
Arvind010
How to assign a profile to the user?
I want to assign a profile to the user.I used the following code:
User SPPuser = new User();
Profile prof = [Select id,Name from Profile where Name = 'Partner Admin User'];
SPPuser.Profile = prof.id;
I am getting an error like:Illegal assignment from Id to SOBJECT:Profile
Please provide me the solution.
User SPPuser = new User();
Profile prof = [Select id,Name from Profile where Name = 'Partner Admin User'];
SPPuser.Profile = prof.id;
I am getting an error like:Illegal assignment from Id to SOBJECT:Profile
Please provide me the solution.
SPPuser.ProfileId = prof.id
As the error says, SPPuser.Profile expects an SObject, not an id.