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

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
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.
All Answers
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.
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);
}
}