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
PtitFredPtitFred 

Problem with INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY ...

Hello, I'm trying to create a Case and I have this error :
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY

This is my script :

$fields = array('type'=>'Case',
     'NOM_CLIENT__c'=>utf8_decode($var1),
     'Subject'=>utf8_decode($var2),
     'ContactId'=>utf8_decode($var3),
     'Code_client__c'=>utf8_decode($var4);
 $SaveResult = $client->create($fields); 

If I create a Case without setting a ContactId I have no error, so the error comes from the ContactId... I don't understand because I thought that I have the permission to set the ContactId... The DescribesObject call says that the ContactId field is updateable and when I do a DescribeGlobal() I see the Case and the Contact Object, so somebody can explain me what's wrong ?

Thanks a lot

DevAngelDevAngel

Hi PtitFred,

Sounds like field level security.  Can you create a case in salesforce.com application logging in as the same user and assign the case to the contact?

GlennAtAppirioGlennAtAppirio
We just ran across the (still) undocumented error code "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY" today while troubleshooting s-control code that creates a new case.

We eventually determined the root cause  -
  • We were trying to assign the contact on the new case.
  • The contact we were using was not associated with any account - thus a "private" contact.
  • The user that was logged in and executing the s-control was not the owner of this private contact, and therefore was restricted from "seeing" the contact.
It was a bit of a "gotcha" and took some time to properly diagnose.

Glenn