function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Adhvika BalaAdhvika Bala 

UNKNOWN_EXCEPTION, portal account owner must have a role: []

I have an apex class that is used to Create Partner users.
However when the class is run to create partner user whoever is creating the partner user account receives an email with this error message.
"UNKNOWN_EXCEPTION, portal account owner must have a role: []"

THe user that runs the code has a role assigned to it as well.

not sure why this is triggering an error.

Please advise.
 
AbhishekAbhishek (Salesforce Developers) 
Hi Adhvika,

You can try the suggestion as mentioned in the below blog,

https://developer.salesforce.com/forums/?id=906F0000000BRdEIAW

Thanks.
Adhvika BalaAdhvika Bala
Yes tried this methods. however I've been constantly receiving Apex exception error emails in my inbox 
(without any DML) operations . not sure why.