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
sgkmillssgkmills 

Triggers failing after activating Spring 09 Critical Updates

I have a trigger on the opportunity object that gets called on the 'After Insert' event.  The code in this trigger creates a record in a custom s-object that I created, call it "SC__c".

 

trigger CreateSCTrigger on Opportunity (after insert) {
if (Trigger.isInsert) {
for (Opportunity o : Trigger.new) {
//Code to create new SC
temp_SC = new SC__c(Opportunity__c=o.Id, Sales_Rep__c=o.OwnerID, CPct__c=100);
insert temp_SC;
}
}

}

 

I also have a trigger on  "SC__c" that gets called on the 'Before Insert' event.  The code for this trigger just changes a field value

trigger UpdateSCTrigger on SC__c (before insert) {
if (Trigger.isInsert) {
if (Trigger.new.size() >=1) {
for (SC__c sc : Trigger.new) {
sc.Sales_Goal__c = sc.SalesGoalID__c;
}
}
}

}

 

So the 'insert temp_SC' line in the CreateSCTrigger, causes the UpdateSCTrigger to fire.

 

This used to work fine, but with the Spring09 changes to the behavior of workflow rules and roll-up summary field evaluations, the 2nd trigger is causing a 'INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id:' error.

 

Why would this be?  Any help will be greatly appreciated.

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers) 
sgkmillssgkmills

The reason why this error was coming up was because we created a sandbox to test the new Cricital Updates, but there wasn't any data in the objects, so when  the SalesGoalID__c value  was being copied, it was failing.

 

To correct it, we just created a couple of records under the apporpriate object in the sandbox and the issue went away. 

 

So it seems my triggers are not failing anymore!  

 

Thanks

All Answers

Venkat PolisettVenkat Polisett

I believe this has some thing to do with the access privileges. It seems you do not have access on the temp object. Check if the permissions have been changed.

 

The critical update only prevents the work flow from firing a second time as a result of a rollup summary field udpate. Please refer to the Spring '09 release notes for further info on this.

 

sgkmillssgkmills

The reason why this error was coming up was because we created a sandbox to test the new Cricital Updates, but there wasn't any data in the objects, so when  the SalesGoalID__c value  was being copied, it was failing.

 

To correct it, we just created a couple of records under the apporpriate object in the sandbox and the issue went away. 

 

So it seems my triggers are not failing anymore!  

 

Thanks

This was selected as the best answer