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
tinman44tinman44 

Apex error...ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE

All-
 
I searched the boards for this one with no luck. I have a trigger that is throwing an error in certian cases. I have not been able to identify the exact use case that is throwing the error...but I thought I would throw it out here to see if anyone has seen this.
 
I have a trigger that is on the event that figures the next activty data for all accounts it is associated with. Basically every time an event is saved I go out and figure out all contacts and accounts associated with it then grab all events assocaited with them then figure out when the next event is. Then I stick that date on the accounts. This way the reps know when there next event is on the list views.
 
So every so often I get this error sent to me.
 
Code:
"ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE, entity failed ifModifiedBefore "
 
I looked in the documentation and found this def of the error:
 
Code:
"You cannot update a record if the date inLastModifiedDate is later than the current date. "

 
However I am not setting/touching the last modified date. Very wierd. Not sure what is going on. Items to note...this is in a international org and the error only seems to be being triggered by users in Japan.
 
Any help/insight would be greatly appreciated!
 


Message Edited by tinman44 on 12-29-2008 07:37 AM

Message Edited by tinman44 on 12-29-2008 07:37 AM
Best Answer chosen by Admin (Salesforce Developers) 
PerGeertPerGeert

I just got a similar error for the first time from a user in Brazil. My scenario is an Account trigger, which updates related Contacts.

However, my thought is that this user is using the Offline Client and is getting the error during synchronization. I.e. I do not know the clock-setting on his laptop, but lets assume it is off, then what would happen?

I am trying to investigate.

Message Edited by PerGeert on 08-26-2009 06:29 PM

All Answers

PerGeertPerGeert

I just got a similar error for the first time from a user in Brazil. My scenario is an Account trigger, which updates related Contacts.

However, my thought is that this user is using the Offline Client and is getting the error during synchronization. I.e. I do not know the clock-setting on his laptop, but lets assume it is off, then what would happen?

I am trying to investigate.

Message Edited by PerGeert on 08-26-2009 06:29 PM
This was selected as the best answer
SoksamnangSoksamnang

I am Samnang from GaeaSys.

I have create trigger for Opportunity on (insert,update,delete event). All event alway update its campaign. when u use offline salesforce client for synchronizing the Opportunities. it is not problem if i just add new opportunity or update opportunity or delete opportunity then  synchronizing. but when i add  Opportunity and update Opportunity then synchronizing. i got  Apex error...ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE on my trigger. how can i solve this problem if our bussiness need to update the same campaign

 

Trigger:Opportunity 

======================================================

trigger tgrOpportunity on Opportunity (before Insert,After Insert,before update,after update,before delete,after undelete) {

if (Trigger.isInsert){

if (Trigger.isBefore){

// before insert

  clsOpportunity.assignCampaignId(Trigger.new);

}else if (Trigger.isAfter){

// after insert

System.debug('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Insert<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<');

clsOpportunity.updateCampaign(true,null,Trigger.new);

}

}else if (Trigger.isDelete){

    // before delete

System.debug('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Delete<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<');

clsOpportunity.updateCampaignDelete(Trigger.old);

}else if (Trigger.isUpdate){

if (Trigger.isBefore){

// before update

clsOpportunity.assignCampaignId(Trigger.new);

}else if (Trigger.isAfter){

// after update

System.debug('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Update<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<');

clsOpportunity.updateCampaign(false,Trigger.old,Trigger.new);

}

      

}else{

//after undelete

System.debug('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Undelete<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<');

  clsOpportunity.updateCampaign(true,null,Trigger.new);

    

}

 

}