• tesi
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

With standard pages concurrent editing of the same record are detected and responded with following message: "The record you were editing was modified by <user> during your edit session." This is not true for Visualforce page or web service API request (this makes sense):

 

How do you solve this situation when concurrency is required? Of course, we can leverage standard patterns like versioning...but this would require validation rules/workflow rules or triggers for each object we leverage in Visualforce...I cannot believe there is no standard way, isn't it?

 

Example how to simulate this:

1. Standard Pages

User A loads one record, like https://na12.salesforce.com/001U0000003MZzI

User B loads the same record in standard page like https://na12.salesforce.com/001U0000003MZzI

User A changes the record and saves.

User B changes as well and tries to save: "The record you were editing was modified by User A during your edit session." CORRECT!

 

2. Standard Page -> VF Page

User A loads one record in standard page like https://na12.salesforce.com/001U0000003MZzI

User B loads the same record in a VF page like  https://na12.salesforce.com/apex/TransactionTest?id=001U0000003MZzI

User A changes the record and saves.

User B changes the record as well and saves. Record get's saved without any error message! WRONG!



Any ideas appreciated...

 

Best regards,

  • September 04, 2011
  • Like
  • 0