You need to sign in to do that
Don't have an account?
Yogesh Malbhage 18
portal account owner must have a role: [] exception is Salesforce
While inserting an user we are getting an exception mentioned above.
Please provide a solution ASAP as it is very ritical.
Thanks in advance!!!!
Please provide a solution ASAP as it is very ritical.
Thanks in advance!!!!
Greetings to you!
This error is generated because the user was not assigned a role.
You will also see this same error (for the same reason) when trying to enable a contact as a partner or customer portal user.
The following sample code demonstrates how to avoid this error:
Please refer to the below links which might help you further.
https://help.salesforce.com/articleView?id=000175522&type=1
https://www.xgeek.net/salesforce/to-fix-portal-account-owner-must-have-a-role-error-in-salesforce-community-unit-test/
http://www.fishofprey.com/2015/08/salesforce-unknownexception-portal.html
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Thanks for your quick response.
My case is simila to the solution you provided as https://help.salesforce.com/articleView?id=000175522&type=1
The solution says i should go to user edit page and assign a role.
But my question is how can I go to user edit page as user itself has not created due to an eception mentioed above. Please help me through this.
Please refer to below links with a similar discussion which might help you further.
https://developer.salesforce.com/forums/?id=906F0000000BRdEIAW
https://developer.salesforce.com/forums/?id=9060G0000005dRHQAY
I hope it helps you.
Kindly mark this as solved if the information was helpful. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
We are using the following code.
can you please tell me what is wrong with this code? It is same as in the solution provided above. but still I am getting an error since account owner of the related contact is not having role.