The number can be one of the following: -1 : all records.0 : current record.n : row n of the current foundset (i.e 20 is the twentieth row of the current foundset). Examples: //Locks the current foundsetdatabaseManager.acquireLock(foundset, -1) //Locks the current rowdatabaseManager.acquireLock(foundset, 0) //Locks all related orders for the current CustomerdatabaseManager.acquireLock(CustomerstoOrders, -1)
If you want to lock the current record at the moment a user clicks into a field, then use the “onRecordEditStart” property of a form. By letting that property trigger a method that contains: databaseManager.acquireLock(CustomerstoOrders, -1)) You can automatically lock a record when a user clicks into it.You can release the lock by having an onRecordSave method on your form.
Question: In the example shown for locking the current record onRecordEditStart a -1 parameter is shown. Does this lock the current record or all records in the foundset?
Looks to me like you may have uncovered a minor error in the docs.
I think that the wrong code snippet has been entered for that record lock example - using the related found set illustration as opposed to the current record.
Perhaps that text block should read:
If you want to lock the current record at the moment a user clicks into a field, then use the “onRecordEditStart” property of a form.
By letting that property trigger a method that contains: databaseManager.acquireLock(foundset , 0))
You can automatically lock a record when a user clicks into it.You can release the lock by having an onRecordSave method on your form.
Always worth letting Marc Norman know of these errata.
This one seems to date back to the first set of docs that I had with v2.x so it has just not been picked up until now