$.udb(ds).setBusy()
note
This article is about the setBusy() function of the DataSourceContainer object.
$.udb(ds).setBusy()
Sets the busy status of the first data source in the container. This can, for example, be used to prevent two operations from being executed simultaneously on the same data source.
Returns a boolean: the resulting busy status of the data source, which is true if the data source itself was set busy, or if any of its rowsets are busy.
Syntax
$.udb( *ds* ).setBusy( *value* )
The required ds parameter is a data source selector.
The required value is a boolean that sets the busy status of the data source.
note
Overrides the .busy() value of its row sets, if set to true. If false, any busy setting of its row sets can still make .busy() return a value of true.
Example
// prevent two fast, consecutive deletes on the same record from being handled simultaneously
let dsc = $.udb('EMP');
if (!dsc.busy()) {
dsc.setBusy(true);
dsc.rows('current').rowDelete().finally(() => {
dsc.setBusy(false);
});
}