Hi, is it possible to lock a record to avoid overriding the other users data, if

Hi, is it possible to lock a record to avoid overriding the other users data, if two users are in the same form? How can we achieve this functionality in SAIL interfaces.

OriginalPostID-140286

OriginalPostID-140286

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    You can build your own record locking functionality quite simply.
    I'm assuming you have an entity backed record for this example where upon the start of a related action that updates the record data the 1st thing you'd do is query a record lock table and if null insert a row that would hold the recordId, user, timestamp. This row would then be deleted upon completion of the update action. If any other user attempts to access the same record (whilst a row exists in your lock table) you can route them off to an error screen. For a more optimistic method you could consider querying the record lock table within a with() expression in your SAIL form but performance concerns would probably rule this out. You will also need to consider how to release locks on incomplete processes etc.
Reply
  • 0
    Certified Lead Developer
    You can build your own record locking functionality quite simply.
    I'm assuming you have an entity backed record for this example where upon the start of a related action that updates the record data the 1st thing you'd do is query a record lock table and if null insert a row that would hold the recordId, user, timestamp. This row would then be deleted upon completion of the update action. If any other user attempts to access the same record (whilst a row exists in your lock table) you can route them off to an error screen. For a more optimistic method you could consider querying the record lock table within a with() expression in your SAIL form but performance concerns would probably rule this out. You will also need to consider how to release locks on incomplete processes etc.
Children
No Data