3.5.1 Documentation on Record Locks

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?

Thanks - Michael

-1 generally stands for ‘all’ within Servoy, as in this case

So the example shown is not congruent with the stated intention?

I.e. - the doc’s say to “lock the record” whereas the code snippet actually “locks the foundset” by virtue of the -1 parameter?

Could be, why don’t you test it?

Hi Michael,

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 :shock:

Cheers
Harry

Hi Harry,

Do you have Marc Norman’s contact coordinates? I will forward this thread reference to him.

Thanks

Michael

mnorman at servoy dot com but I am pretty sure he will read this as well…

Thanks - I passed an email through to Marc.

Best,

Michael

Michael Mooney:
Thanks - I passed an email through to Marc.

Best,

Michael

Michael and all,

The errata will be corrected in the next version of the documentation.

We appreciate the input and the knowledge that many of you in the
Servoy community DO carefully read the Servoy documentation.


Marc Norman
Servoy