You need to sign in to do that
Don't have an account?

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id
Hi,
I never had problems running my test method on my developer's edition before.
But now I created a new salesforce account and have all my triggers here. I am getting an error when I run my test method on this newly created instance.
Error:
DML Operation executed in 180 ms
System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id
Do I need to set some rights/roles or privileges on this newly created account? Quick help would be appreciated.
Thanks,
Kathyani
I never had problems running my test method on my developer's edition before.
But now I created a new salesforce account and have all my triggers here. I am getting an error when I run my test method on this newly created instance.
Error:
DML Operation executed in 180 ms
System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id
Do I need to set some rights/roles or privileges on this newly created account? Quick help would be appreciated.
Thanks,
Kathyani
Now that you are in production the server can't find the object you are looking for.
Or another reason this could happen is the user doing executing the code doesn't have rights to a record type you have in test.
As an admin in production do you get the same error?
All Answers
Now that you are in production the server can't find the object you are looking for.
Or another reason this could happen is the user doing executing the code doesn't have rights to a record type you have in test.
As an admin in production do you get the same error?
static testMethod void testBillAfterTrigger() {
// First Bill
Bill__c bill1 = new Bill__c();
bill1.ServiceNumber__c = '(111) 555-5555';
bill1.ServiceName__c = 'at&t';
bill1.RatePlanName__c = 'My New Test Plan';
bill1.ATTDownloadDateString__c = '100107';
bill1.TotalMinutesOfUse__c = 800.0;
bill1.MonthlyAccessCharges__c = 100.0;
bill1.TotalCurrentCharges__c = 355.0;
bill1.FoundationAccountNumber__c = 'TESTFAN';
// Second Bill
Bill__c bill2 = new Bill__c();
bill2.ServiceNumber__c = '(333) 555-5555';
bill2.ServiceName__c = 'verizon';
bill2.RatePlanName__c = 'My New Test Plan';
bill2.ATTDownloadDateString__c = '120107';
bill2.TotalMinutesOfUse__c = 800;
bill2.MonthlyAccessCharges__c = 400.0;
bill2.TotalCurrentCharges__c = 555.0;
bill2.FoundationAccountNumber__c = 'TESTFAN';
// Create a list of all the above bills
List <Bill__c> bList = new List<Bill__c>();
bList.add(bill1);
bList.add(bill2);
System.debug('bList size' + bList.size());
insert bList;
}
is it a lookup to accounts?
Please post the trigger or code on Bill__c, the apex error message should tell you what class or trigger and the line of the offending code.
Thanks for your help.