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

OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type: []
I created a public site and enable it for customer community login. When I login as a community user, I need to create an Account record. But everytime when I try to create an Account record as a community user, I get the error message saying "OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type: []". I rememebered that there is no problem to create Account records with customer portal or partner portal, even if the customer portal doesn't have create permission, since we already run the apex class in system admin mode. But why we can't do that with community user? Did anybody encounter the same problem or know how to solve this problem? Any suggestions will be helpful. Thanks in advance!!
Hello,
In the error message, the class must have been provided where the error is occurring. Please share the code, else check if you are making any license related constraints in your code.
Thanks for your information.
The code is quite simple, I just enable the community in our dev org, and create a community user. Then I logged in as the community user run a simple page, where I tried to create an Account record, but failed with the above error message.
The code is as simple as:
Any idea?
OwnerId - It should have a user id and that user should have a role assigned.
Assign owner id to the account and you will be able to fix the problem.