• NickCA
  • 10 Points
  • Member since 2017
  • Software Engineer
  • Client Acquire

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 6
Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
Error is in expression '{!genDoc2}' in component <apex:commandButton> in page doccontrolgather: Class.DocControlQuery.SavePDF: line 203, column 1
Class.DocControlQuery.genDoc2: line 120, column 1

I need help with this apex code.  I am not a coder :-S

Hi All,
I am trying to share custom object record from one Salesforce account to another salesforce account throgh poral user and i am getting this error while sharing Data.
I already check profile setting and give read,create,edit access.still i am getting this issue
Hi All,
Facing an issue which has halted many processes. I have an approval button for payment which on click converts the lead to an account and corresponding Opportunity . In production everything works fine but recently our org refreshed the sandbox. 
Now none of the leads are converting. Sharing an error . Please help .

faultcode:soapenv:client: --------> Unavailable recordtype exception.
We have person accounts in our org. to whom we need to give access to our customer community at various stages of an opportunity.

Is there a way we can programmatically enable our person accounts as customer users using apex ?

We have Customer Community Login licenses available in our org

Hi All,


Now,am working on web-to-lead using custom controller.I have written a workflow to send a email alert.When I give the inputs for required fields and submit it. Lead info is not stored in Lead object and in debug log , i have seen the following exception,

System.DmlException: Insert failed. First exception on row 0; first error: UNAVAILABLE_RECORDTYPE_EXCEPTION, Unable to find default record type


I have set the default record type for Lead.But Lead is not stored.


Whenever I deactivated the workflow, it works fine and there is no exception arises .Please guide me to clear this one.


Thanks in advance.


I need ur help !!

I am getting error INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id:[] Trigger.ShareOperatingUnits:  when test code covereag.


Test class ::

private class TestNewWorkOrder {

    static testMethod void myUnitTest() {
        User usr1 = [select id, Name, ProfileId  from User where Profile.Name = 'System Administrator' limit 1 ];
        System.runAs(usr1) {  
        Object__c ou = new Object__c();
        ou.Branch_Manager__c = UserInfo.getUserId();
        ou.Name = 'Test';
        insert ou;



After insert Trigger::

trigger ShareOperatingUnits on Object__c (after insert, after update) {
    List<Object__Share> ouShareList = new List<Object__Share>();

    for(Object__c ou: Trigger.New) {
        Object__Share ouShare = new Object__Share();
        ouShare.ParentId  = ou.Id;
        ouShare.UserOrGroupId = ou.Branch_Manager__c;
        ouShare.AccessLevel = 'Read';

   insert ouShareList;   // HERE I M GETTING ERROR



Please tell me what i done wrong .

I think i need to make some changes on object side my trigger is working fine but getting prblm for test coverage .

Please help me !!


Many Thnks In Advance