afterCreate event
- Last Updated: December 13, 2016
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
afterCreate event
Fires after the JSDO, by means of a saveChanges( ) call following an add( ) call, sends a request to create a record in the Data Object
resource and receives a response to this request from the server.
This event fires after the response from a Create operation request (sent without using Submit) has been received, and fires after the response from a Submit operation request for each one of possibly multiple record creates has been received.
saveChanges( ) or saveChanges(false). A single Submit operation request for any and
all created, updated, and deleted JSDO record objects is sent with a single call to saveChanges(true).Applies to: progress.data.JSDO class, table reference property (JSDO class)
The following parameters appear in the signature of any event handler (callback) function (or functions) that you subscribe to this event:
Syntax
|
- jsdo
- A reference to the JSDO that invoked the create request. For more information, see the description of jsdo property of the request object.
- record
- A reference to the table record upon which the create request acted. For more information, see the description of jsrecord property of the request object.
- success
- A
booleanthat istrueif the create request was successful. For more information, see the description of success property of the request object. - request
- A reference to the request object returned after the create request completes. For more information, see the description of request object.
Application code can subscribe a callback to this event by invoking the
subscribe( ) method on a JSDO instance or one of its
table references.
Example
The following code fragment subscribes the function, onAfterCreate, to handle the afterCreate event fired on the JSDO, myjsdo,
created for an OpenEdge single-table resource, ttCustomer, where newRecordData is an object containing the field values to set in
the new record:
|
See also:
add( ) method, beforeCreate event, record property, saveChanges( ) method, subscribe( ) method (JSDO class), unsubscribe( ) method (JSDO class)