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

How to insert record in Account Object in Community
Hi,
I am able to insert Record in Account Object in Lightning. But i am not able to insert Record in Community.And getting Error like
Insert failed. First exception on row 0; first error: OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type
And For that i had written Apex Class Below
@AuraEnabled
Public Static Account createAccountRecord(Account newAccountdata) {
if(newAccountdata !=null){
newAccountdata.ownerId = UserInfo.getUserId();
insert newAccountdata;
System.debug('newAccountdata--'+newAccountdata);
}
return newAccountdata;
}
Can anyone help me....
I am able to insert Record in Account Object in Lightning. But i am not able to insert Record in Community.And getting Error like
Insert failed. First exception on row 0; first error: OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type
And For that i had written Apex Class Below
@AuraEnabled
Public Static Account createAccountRecord(Account newAccountdata) {
if(newAccountdata !=null){
newAccountdata.ownerId = UserInfo.getUserId();
insert newAccountdata;
System.debug('newAccountdata--'+newAccountdata);
}
return newAccountdata;
}
Can anyone help me....
Hi Soumya,
Make sure that the Apex class is added to the profile which will be accessing the community, and also check settings for "Account" object under that profile. Enable "Create" if that is already not done.