$.udb.rollback()
note
This article is about the rollback() function of the udb object.
$.udb.rollback()
Rolls back manipulated data.
Returns a UdbPromise object.
Syntax
$.udb.rollback( *options* )
.then(() => {
// success
})
.catch(() => {
// failure
})
.finally(() => {
// executed after success / failure is handled
});
*options* ::= {
[keepSelections]: *keep-selections*,
[quiet]: *quiet*
}
*keep-selections* ::= { [true] | false }
*quiet* ::= { true | [false] }
Options is a struct that can have the following items, all of which are optional.
Keep-selections is a boolean that specifies whether the current selected record remains the same after rollback:
| Value | Description |
|---|---|
true (the default) | The current record is guaranteed to be the same record as before the rollback, in the sense of "the same data": the record with the same primary key values. |
false | The current record after rollback is guaranteed to be the record that has the same position in the row set as the current record had before the rollback. |
Quiet is a boolean that determines whether or not a message is displayed when the rollback is completed. The default is false, meaning that a message is displayed by default.
Example
$.udb.rollback({ quiet: true })
.then( () => {
alert('Succeeded!');
});
Related events
| Event | Applies to | Occurs when |
|---|---|---|
| beforerollback | Page objects | Before each rollback action |
| postrollback | Page objects (triggered globally on UdbApplication) | Right after a rollback action has completed |