AdvantageModule..::..Client_ObjectLock Method
Requests an object lock for a specified user and master identifier.
This will attempt to lock the record on the server and return the status. It will generate the javascript client code to poll for refresh/locking.
Successful API requests will return the status of the lock : { Status: 0, Message: '', UserName: '' }.
Status
- Error = -1
- Unlocked = 0
- Locked = 0
- LockedByOtherSession = 0
Message
- The return message from the lock request
UserName
- The user who currently owns the lock
Assembly: AdvantageCMS.Core (in AdvantageCMS.Core.dll)
Syntax
Parameters
- userLockKey
- Type: String
The unique key identifying the user lock.
- masterId
- Type: Guid
The identifier of the master object to be locked.
- userName
- Type: String
The name of the user requesting the lock.
- successFunction
- Type: String
i.e. successLock(data)
The function to be executed upon successful lock acquisition. A JavaScript Object parameter with properties will be returned: { Status: 1, Message: '', UserName: '' }
- failureFunction
- Type: String
i.e. failedLock(data)
The function to be executed upon failure to acquire the lock. A JavaScript Object parameter with properties will be returned: { Status: 0, Message: '', UserName: '' }
- refreshSeconds
- Type: Int32
- delayUnlockSeconds
- Type: Int32
The number of seconds to delay before expiring the lock