beforeCreate event
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
beforeCreate event
Fires before the JSDO, by means of a saveChanges( ) call following an add( ) call, sends a request to create a record in the Data Object
resource on the server.
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)
Syntax
The following parameters appear in the signature of any event handler (callback) function (or functions) that you subscribe to this event:
|
- jsdo
- A reference to the JSDO that is invoking 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 is about to act. For more information, see the description of jsrecord property of the request object.
- request
- A reference to the request object before the create request is sent. 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, onBeforeCreate, to handle the beforeCreate event fired on the JSDO, myjsdo,
created for a single-table resource, by assigning data to the newly created record before
sending it to the server:
|
See also:
add( ) method, afterCreate event, record property, saveChanges( ) method, subscribe( ) method (JSDO class), unsubscribe( ) method (JSDO class)