Rows.rowDelete()

  • 1 August 2022
  • 0 replies
  • 72 views

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

Rows.rowDelete()

Deletes rows from the database.

Contrast with Rows.rowRemove() which removes rows only from the client browser.

Returns a Promise object or the 'this' object. From USoft 10.0.1I, returns a udbPromise instead of a Promise object.

Syntax

rows.rowDelete( options )

options ::= {
check: check-function,
promise: promise,
success: success-function,
error: error-function
}

promise ::= { true | false }

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

Check-function is a function called before the records are deleted. Use the return value of this function to determine whether or not you want the rows to be deleted.

Promise determines the return value of this function. If promise has the value of 'true' (the default), a Promise object is returned. If promise has the value of 'false', the ‘this’ object is returned instead.

Success-function is a function called after the records are successfully deleted.

Error-function is a function called if an error occurs.

Example

$.udb('EMP').rows({EMPNO:5}).rowDelete({
check: function(r){
alert('Deleted: ' + r.val('EMPNO'));
return true;
}
});

Related events

Event Applies to Occurs when
rowpredelete Data source objects Before a record is deleted
rowpostdelete Data source objects After a record is deleted

 


0 replies

Be the first to reply!

Reply