remove( ) method
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Deletes the specified table record referenced in JSDO memory.
The specified record can either be the working record of a referenced table or any record
provided by a JSRecord object.
To synchronize the change on the server, call the saveChanges( ) method.
Return type:
boolean
Applies to: progress.data.JSRecord class, progress.data.JSDO class, table reference property (JSDO class)
Working record: After execution, any prior working record setting for the affected table, and for any of its child tables, is no longer set.
Syntax
|
- jsrecord-ref
- A reference to a
JSRecordobject for a table record in JSDO memory.You can obtain a
JSRecordobject by:- Invoking a JSDO method that returns record objects from a JSDO
table reference (
find( ),findById( ), orforeach( )) - Accessing the
recordproperty on a JSDO table reference that already has a working record. - Accessing the record parameter
passed to the callback of a JSDO
afterCreate,afterDelete, orafterDeleteevent. - Accessing each record object provided by the
jsrecordsproperty on the request object parameter passed to the callback of a JSDOafterSaveChangesevent, or passed to the callback of any Promise object returned from thesaveChanges( )method. Thejsrecordsproperty is only available on completion of a Submit operation (saveChanges(true)) on a resource that supports before-imaging, and not if the resource supports before-imaging without Submit.
- Invoking a JSDO method that returns record objects from a JSDO
table reference (
- jsdo-ref
- A reference to the JSDO. You can call the method on jsdo-ref if the JSDO has only a single table reference, and that table reference has a working record.
- table-ref
- A table reference on the JSDO that has a working record.
sort( ) method by passing it the same
sort function that you used to establish the previous sort order.Example
The following code fragment shows a jQuery event defined on a delete button to delete the
record displayed in a customer detail form from the eCustomer table
referenced in JSDO memory:
|
The form has been previously displayed with values from the same record. When the button is
clicked, the event handler uses the findById( ) method to find the original
record with the matching internal record ID (jsrecord) and invokes the
remove( ) method on jsrecord to delete the record from
eCustomer.