Skip to main content
Version: 11.2

Rows.refresh()

note

This article is about the refresh() function of the Rows object.

Rows.refresh()

Refreshes the rows in scope, so that the client has the same records and the same values in these records as the server.

Returns a UdbPromise object with the UdbRows object as parameter.

Syntax

$.udb( *ds* ).rows( [rowRef1], [rowRef2] ).refresh( [options] )
.then( ( *rows* ) => {
// success
})
.catch(() => {
// failure
})
.finally(() => {
// executed after success / failure is handled
});
$.udb( *ds* ).rowSet( *rowSet* ).rows( [rowRef1], [rowRef2] ).refresh( [options] )
.then( ( *rows* ) => {
// success
})
.catch(() => {
// failure
})
.finally(() => {
// executed after success / failure is handled
});

*options* ::= {
[hostvars]: *hostvars*
}

*hostvars* ::= { *name* : *value*, ... }

The required ds parameter is a data source selector.

The optional rowSet parameter is a rowset identifier. If the .rowSet() clause is omitted, then .rowSet('current') is assumed.

The optional rowRef1, rowRef2 are row selectors. If omitted, all records in scope are addressed.

Options is a struct that can contain the following items, all of which are optional.

The optional hostvars is a set of (temporary) name-value pairs that are passed to the refresh as variables, merged with any hostvars already set on the row set, e.g. by an earlier .executeQuery() call.

To consult before the refresh takes place, or to react after it completes, use the rowprerefresh/rowpostrefresh events listed below, rather than a callback option.

Example 1

$.udb('EMP').rows('current').refresh();

Example 2

To refresh all rows where MANAGER is NULL and SALARY is higher than 35000:

$.udb('EMP').rows('condition', { MANAGER: 'NULL', SALARY: '>35000' }).refresh();
EventApplies toOccurs when
rowprerefreshData source objectsBefore a record is refreshed
rowpostrefreshData source objectsAfter a record is refreshed