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
ankushankush 

System.DmlException: Insert failed. First exception on row 0; first error: OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type: []

I have a scenario where I am trying to run a method as a portal user and that method inturn creates a new account but when I try to do the same I am getting the below error can some one please help me.

System.DmlException: Insert failed. First exception on row 0; first error: OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type: []
Shrikant BagalShrikant Bagal
Hello ankush,

Please check the Create Permission for that User for Account Object.

Thanks!
Vetriselvan ManoharanVetriselvan Manoharan
Hi Ankush,

Check out whether the user has read write access to account object?

Thanks,
Vetri
ankushankush
I am checked it it has both read and edit access on Account but still unable to run the case.
Ghanshyam Kumar 9Ghanshyam Kumar 9

Hi Ankush,
I got your issue.

If you have read and write access to Account then check if you have ownerID assigned to account while creating it.

OwnerId - It should have a user id and that user should have a role assigned.