+ Start a Discussion
BxBBxB 

Error while synchronizing from offline mode: ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE

Hi All,

I have a specific requirement in which all the contacts of a particular account are assigned a Rank and the contact with the best Rank is considered as the Primary Contact and the Overall Rating and Contact Name of the Primary Contact is then updated to the corresponding Account.

Calculation of rank, identification of the primary contact and updating its overall rating to the account is done using a future class, which is called from a Trigger. Trigger is executed for After Insert, After Update and Before Delete.
And moreover all this process needs to be executed when synchronized from offline mode.

When a delete a Contact in offline Mode and if the same contact or its corresponding account was edited or modified in the online mode (salesforce org), and then try to synchronize my offline edition I end up getting the following exception:
"
caused by: System.DmlException: Update failed. First exception on row 0 with id xxxx000000xxxxxxxx; first error: ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE, entity failed ifModifiedBefore test on update: []
"
Any inputs on why this is happening and how it could be resolved would be really helpful.
Waiting for your response!

Thanks in advance,
Baradia
Cool_DevloperCool_Devloper

Mr Baradia,

Can you please tell, why it the trigger event kept as "Before Delete" rather then being "After Delete"?

 

As i understand your requirement, you want to recalculate the logic, once a contact is deleted, right?

Cool_D