Skip to main content
Version: 11.2

$.udb(ds).isUpdatable()

note

This article is about the isUpdatable() function of the DataSourceContainer object.

$.udb(ds).isUpdatable()

Detects whether the first data source in the container is updatable.

Returns 'true', 'false', or 'ifNull'. A value of 'ifNull' means that a column is only updatable while its current value is still empty (NULL), which is commonly used for write-once columns such as creation or audit fields.

Syntax

$.udb( *ds* ).isUpdatable()

The required ds is a data source selector.

Example

// isUpdatable() is a tri-state string, not a plain boolean, so compare
// it against the exact value rather than just testing its truthiness
let updatable = $.udb('EMP').isUpdatable();

if (updatable === 'false') {
console.log('EMP does not allow updating any of its columns');
}
else if (updatable === 'ifNull') {
console.log('EMP only allows updating columns that are currently empty');
}
else {
console.log('EMP allows updating its columns');
}