• BxB
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 0
    Replies
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
  • March 12, 2010
  • Like
  • 0
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
  • March 12, 2010
  • Like
  • 0
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
  • March 09, 2010
  • Like
  • 0

Hi All,

 

I have a requirement in which, whenever a contact is created or updated or deleted a trigger is executed which calls a Future class.

 

Future Class Logic: When a contact is created or updated, Rank is calculated for the contact based on the responses provided for certain fields. Calculated Rank and its corresponding Overall Rating are populated in their respective two fields (on Contact Object) and the contact is updated.

After updating the contacts Rank and Overall Rating, its account id is fetched, based on this all the contacts related to the fetched account are stored in a map. After storing all the related contacts in a map, a business logic is run based on which the contact with the best overall rating is identified and the overall rating of this best contact is updated on the corresponding account. 

 

This business logic needs to run in both online and offline (when synchronized from offline mode) mode. Entire business logic seems to be running fine but I get an apex exception mail in some scenarios stating:

 

" 'public static void Methodname(SET:Id)' : Update failed. First exception on row 0 with id 00xx000000xxxxxxxx; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: [] "

 

I am unable to identify the reason for this exception and how could I resolve it.

 

If anybody can help me in identifying the problem and the way to resolve it, I would appreciate it and be extremely thankful.

 

Waiting for the response.

 

Thanks in advance.

BxB

 

  • March 04, 2010
  • Like
  • 0