You need to sign in to do that
Don't have an account?
Matthew Hofmann
Apex InvocableMethod - INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY error
Hello all,
I have created an Apex class with an InvocableMethod that logs automated outgoing emails as EmailMessage records. The InvocableMethod is called by process builder whenever the process also uses an email alert action. It works very well for myself and other Full Salesforce licesed users. However, when a user with a Customer Community Plus license makes a change to a case which triggers the process, the process fails with an "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY" error.
Salesforce support said that the EmailMessage object is off-limits to this type of license, however the object is available for the user's profile for field-level security. Also this article says that Customer Community Plus licenses have Send Email capability: https://help.salesforce.com/articleView?id=users_license_types_communities.htm&type=5
Has anyone had experience with this or something similar in the past?
I have created an Apex class with an InvocableMethod that logs automated outgoing emails as EmailMessage records. The InvocableMethod is called by process builder whenever the process also uses an email alert action. It works very well for myself and other Full Salesforce licesed users. However, when a user with a Customer Community Plus license makes a change to a case which triggers the process, the process fails with an "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY" error.
Salesforce support said that the EmailMessage object is off-limits to this type of license, however the object is available for the user's profile for field-level security. Also this article says that Customer Community Plus licenses have Send Email capability: https://help.salesforce.com/articleView?id=users_license_types_communities.htm&type=5
Has anyone had experience with this or something similar in the past?
Error element myRule_1_A2 (FlowActionCall).
An Apex error occurred: System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.
Flow Details
Flow Name: Case_Automated_Emails
Type: Workflow
Version: 1
Status: Active
Flow Interview Details
Interview Label: Case_Automated_Emails-1_InterviewLabel
Current User: Test Tech (00529000001RRVZ)
Start time: 12/20/2017 7:04 AM
Duration: 0 seconds
How the Interview Started
Test Tech (00529000001RRVZ) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = 50029000005RIioAAG
myVariable_current = 50029000005RIioAAG
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "12/20/2017 7:04 AM"
DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!myVariable_current.Status} (Tech Scheduled) Equals Tech Scheduled
Logic: All conditions must be true (AND)
DECISION: myRule_1_pmetdec
CASE.SEND_TECHNICIAN_IS_SCHEDULED_COMMUNICATION_CONSUMER (EMAIL ALERTS): myRule_1_A1
Inputs:
SObjectRowId = {!myVariable_current.Id} (50029000005RIioAAG)
Outputs:
None.
EMAILMESSAGEINSERTACTION (APEX): myRule_1_A2
Inputs:
emailTemplateId = 00XF0000000kICN
fromEmailAddress = redated@outboundemail.address
parentCaseId = {!myVariable_current.Id} (50029000005RIioAAG)
toEmailAddress = {!myVariable_current.Contact.Email} (redacted@redacted.redacted)
Error Occurred: An Apex error occurred: System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
Salesforce Error ID: 1854753996-32887 (1243982501)
And test code in case you are curious: