DocuVieware Reference Guide
PostCustomServerAction
Reference Guides > JavaScript API > Actions > Operations > PostCustomServerAction
 PostCustomServerAction

This function allows you to trigger a custom action (with or without parameters, async or not) server side.

This particular feature is demonstrated in the following tutorial, be sure to read it.
The onsuccess callback of the PostCustomServerAction function contains a parameter which is the JSON serialization of the object that has been attached, server side, to the result property (CustomActionEventArgs type) of the object e obtained by parameter of the event CustomAction.
This is usefull when you need to send data from server side to client side, this feature is demonstrated in our Barcode Recognition demo, please be sure to take a look.
PostCustomServerAction: function (docuViewareID, async, actionName, params, success, error)

Parameters

docuViewareID
The identifier for the DocuVieware™ instance you want to trigger your custom action with.
async
A boolean to specify if your custom action has to be asynchronous or not.
actionName
A string that contains your custom action name.
params
A string that contains your custom action parameters (if needed).
success
A function that will be executed upon success.
error
A function that will be executed upon error.

Return Value

1 if error, 0 if success.