Here is sample code that gets the lock listing and unlocks an entry based on its id:
Dim idToUnlock = 100 ' The ID of the entry to unlock
Dim locklisting As LFPLockListing = db.GetLockListing(-1, 100, PLock_Column.PLOCK_COLUMN_ID, Sort_Direction.SORT_DIRECTION_ASC)
For i = 1 To locklisting.RowCount
Dim lockdata As LFPLockData = locklisting.PLockData(i)
If lockdata.Lifetime = Lock_Lifetime_Scope.LOCK_LIFETIME_SESSION Then
Dim entry As ILFEntry = lockdata.Entry
If entry.ID = idToUnlock Then ' Found the entry by id
lockdata.IsLocked = False
lockdata.Update()
End If
End If
Next
GetLockListing takes four parameters:
- connID: The Laserfiche connection ID, or -1 for all connections (you should be an admin to get all connections, or you can specify your own connection ID from your ILFConnection.ID
- RowsToPreload: The number of rows to retrieve in the first request. Not really important, 100 is a good value.
- SortColumn: The PLock_Column to sort on.
- Sort_Direction: SORT_DIRECTION_ASC or SORT_DIRECTION_DESC.