You need to sign in to do that
Don't have an account?
Rahul 12
NSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY
i have created a site in my org.While i am submitting user entered data for a custom field.i am getting error for INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id.
for case object.
below is my code :
SurveyTaker__c is my custom object.I have lookup relationship with case for this custom field
SurveyTaker__c st = new SurveyTaker__c();
st.Contact__c = contactId;
st.Survey__c = surveyId;
st.Taken__c = 'false';
st.Case__c = caseId;
// st.Case__c='50055000000xALF';
st.User__c = userId;
insert st;
Thanks in advance
for case object.
below is my code :
SurveyTaker__c is my custom object.I have lookup relationship with case for this custom field
SurveyTaker__c st = new SurveyTaker__c();
st.Contact__c = contactId;
st.Survey__c = surveyId;
st.Taken__c = 'false';
st.Case__c = caseId;
// st.Case__c='50055000000xALF';
st.User__c = userId;
insert st;
Thanks in advance
You don't have access right on Case object that is why this error is coming. You need to give permission for Case object.
Makes sense ?
Thanks,
Himanshu
- Goto Setup->Developer->Sites and then select your site
- Then click Public Access settings
- Then click Object settings
- Then enable Create premission access and save your changes
Now user can able to create record from your site.Actually in the controller 'With Sharing' condtion was there in class, once i removed that.it's working fine.
You can remove With Sharing from your class but that is not best practice to do because code now runs in sys admin context instead of end user, it means any user can update any record.