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
Eduard NistorEduard Nistor 

APEX code issue? We receive the error "system.security.NoAccessException"

When we create a new email or reply to an email from a case, after clicking on send, we receive this error - https://prnt.sc/p85v24. Asked for customer support assistance and they advised that it might be an APEX code issue and to come ask here.

I appreciate the help
Rounak SharmaRounak Sharma
Hello Eduard,

Check if the particular profile has the access for the same. 
Eduard NistorEduard Nistor
Hello Rounak,

If the particular profile has the access for the same what?

Thank you,
Eduard
Rounak SharmaRounak Sharma
yes
Please try this once
Navigate to Setup > Profiles > Search for the respective User's Profile > Edit > Apex Class Access.

Please mark this thread as SOLVED and answer as the BEST ANSWER if it helps address your issue.
thanks
Eduard NistorEduard Nistor
Hello Rounak,

This setting doesn't exist for the agents, so it's not helpful, still thank you for trying.

Regards
Suraj SinghSuraj Singh

Yes, its exception comming from the Apex code, but not directly,
You are creating an email message record while you are creating or replying, so there might be a case that any trigger written over that object, that acessesing some other object record, whose permission you don't have.

Please check any trigger on the Email message object.
 

Thanks

Eduard NistorEduard Nistor
Hello Suraj,

Could you walk me through a little bit? I can't find any triggers that might generate that message

Thank you,
Eduard
Joren Van den Brande 16Joren Van den Brande 16

Hello Eduard,

I was wondering if you have found a solution/workarround for your issue in the meantime? 
We are experiencing the same issue at the moment: getting the 'system.security.NoAccessException' error when a user tries to reply to an email.

Thanks,
Joren

Eduard NistorEduard Nistor
Hello Joren,

Yes, we think we found a solution as we didn't receive anymore complaints, basically what we did was to enable the in Profiles - Account - Players object, from what our developer said they didn't have the right to create those and that's why we got the error.

So do give it a try and see if it works for your too.

Regards,
Eduard