hasChanges( ) method
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Returns true if JSDO
memory contains any pending changes (with or without before-image data), and returns
false if JSDO memory has no pending changes.
Return type:
boolean
Applies to: progress.data.JSDO class
Syntax
|
This method always returns true if any change to JSDO
memory has marked a record object it contains as created, updated, or deleted.
This method always returns false if you execute it
immediately after invoking any one of the following methods on the JSDO:
fill( )saveChanges( ), if theautoApplyChangesproperty is also set totrueacceptChanges( )rejectChanges( )
A typical use of this method is to determine if there are any changes in JSDO memory that
you want to save to local storage using the JSDO saveLocal( )
method.
Example
The following code fragment shows an example of how you might use hasChanges( ) to decide how to save JSDO memory to local
storage:
|
The fragment first invokes the fill( ) method on a JSDO
(dataSet) to load JSDO memory, sets the autoApplyChanges property on the JSDO to not automatically accept
or reject changes saved to the server based on the success or failure of the save, and after
a certain amount of work is done with the JSDO, decides to save all
the data in JSDO memory to the default local storage area, or to save only the pending changes, based on whether any pending changes currently exist in
JSDO memory.
See also:
acceptChanges( ) method, autoApplyChanges property, fill( ) method, hasData( ) method, rejectChanges( ) method, saveChanges( ) method, saveLocal( ) method