Blue Exclamation mark

Hi,
Is there a way to catch the ‘Blue Exclamation mark’ and error code produced. So I can pop a dialog for the user explaining what it is?

eg.

If 2 users open the same record are going to edit it would be nice to indicate to the locked out user that “Record # is currently being edited by user1” for example.

As this happens from time to time with my solution , and currently the locked user’s servoy client gives the impression that it is unresponsive.

Thanks in advance

Have you tried specifying a method to run on error in the solution properties. This should catch any errors and allow you to “customize” the user’s experience.

Jason

Hi Jason,
Is that particular error “data broadcasting” available through the ServoyException method, as it is not really a error only information.

Data broadcasting and locking are two separate things. You can test for locks and warn the user accordingly: when you attempt to acquire a lock and don’t get it you could show a message to the user.

Hi Jan,
OK, so does this mean I need to do the following ```
databaseManager.acquireLock()

and then test for locks when the second user opens the same record ??
Many Thanks

Before you start editing, you should call databaseManager.acquireLock(). The function returns a boolean indicating if the lock could be acquired.
When you get true back, you have the lock and you are the only user that can edit the record.
When the editing is finished, for example if the user clicks the “save”-button, you should call databaseManager.releaseAllLocks(); to release the lock.

Take a look at the sample code of acquireLock():

//ask for a lock for specified foundset(-1 is all rows,0 is current row,n is a specified row)
var success = databaseManager.acquireLock(<foundset>,0);
if (!success) {
	plugins.dialogs.showWarningDialog('Alert','Failed to get lock','OK');
}