In This Topic
Reference Guides / JavaScript API / Actions / Requests / PostCustomServerAction


In This Topic

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)


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

Return Value

1 if error, 0 if success.