Promises
- Last Updated: January 23, 2026
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
The JSDO allows most asynchronous methods to return results using ES6 Promises (if available) in addition to any results returned using named events (see Named events). This Promise support is available for the following standard JSDO methods:
-
fill( ) -
invoke( ) -
saveChanges( )
Asynchronous JSDO methods return ES6 Promises. You can call methods on the returned Promise to register functions that will be called depending on whether the Promise resolves or rejects. Each entry for the JSDO methods in the JSDO properties, methods, and events reference show several examples of Promises.
The fill() and saveChanges()methods allow you to return their
asynchronous results using either or both named events and Promises. Note that directly
calling a custom JSDO invocation method asynchronously only returns results using named
events. To return asynchronous results of an invocation method using either or both
named events and Promises, you must call the invocation method using the API provided by
the standard JSDO invoke() method.
Each Promise will be resolved or rejected with an object that contains the outcome of the operation. The following functions return Promises:
-
fill() -
invoke() -
saveChanges()
The objects returned by Promises contain the following fields:
jsdosuccessrequest
This allows you to share callbacks for both subscription to appropriate named events and registration by appropriate Promise methods. When using both named events and Promises to return results for a given asynchronous method, the results are returned to callbacks in the following general order:
- To
before*event callbacks - To
after*event callbacks - to Promise callbacks.
For a more detailed description of results handling for named events and Promises, see the description of each JSDO method that supports Promises in the JSDO properties, methods, and events reference.