JSDO properties, methods, and events reference : beforeInvoke event
  

beforeInvoke event

Fires when a custom invocation method is called asynchronously on a JSDO before the request for the Invoke operation is sent to the server.
Synchronous invocation method calls do not cause this event to fire.
Applies to: progress.data.JSDO class
The following parameters appear in the signature of any event handler (callback) function (or functions) that you subscribe to this event:

Syntax

function ( jsdo , request )
jsdo
A reference to the JSDO that is invoking the method. For more information, see the description of jsdo property of the request object.
request
A reference to the request object returned before the operation begins. 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.
Note: To subscribe a handler for this event, the subscribe( ) method requires that you pass, as a parameter, the name of the invocation method to which the event applies.

Example

The following code fragment subscribes the function, onBeforeInvokeGetOrderTotalAndStatus, to handle the beforeInvoke event fired on the JSDO, dataSet, for an invocation of the getOrderTotalAndStatus( ) invocation method passed the parameters specified by paramObject:
dataSet = new progress.data.JSDO( 'dsCustomerOrder' );
dataSet.subscribe( 'beforeInvoke', 'getOrderTotalAndStatus',
onAfterInvokeGetOrderTotalAndStatus );

dataSet.getOrderTotalAndStatus( paramObject );
    
function onAfterInvokeGetOrderTotalAndStatus ( jsdo , request ) {
    /* code to execute before sending request to the server */
};

See also:

afterInvoke event, invocation method, subscribe( ) method (JSDO class), unsubscribe( ) method (JSDO class)