JavaScript API for scheduling any activity in offline mode
The API for scheduling activities helps you handle use cases that are unsupported in offline mode, by calling a JavaScript method that places any activity in the action queue. The actions are then run when the mobile app comes back online.
The app does not wait for a response from the scheduled activity.You can use the activity scheduling feature, for example, to send a request for additional attachments to the originator of a case.
Example
You can use the Run script action and create a JavaScript function that contains your code,
similarly to the following sample code. In the example, you call the
callActivity activity through the addAction()
method
for the window.pms.plugins.clientstore
object. The data represents the
primary page against which the activity is executed, and the parameters JSON array
represents the list of parameters to set on the Parameter page.
var metadata = {
"action":"callActivity",
"activityName":"TestActivity",
"className" :"PegaSample",
"parameters": [
{"param1":"foo"},
{"param2":"bar"}
]
};
var data = {
"pxCreateDateTime": "20140421T215505.976 GMT",
"LastName":"Smith",
"FirstName":"Joe",
"Language":"English",
"pxObjClass":"Data-"
};
window.pms.plugins.clientstore.addAction(metadata, data);
Previous topic JavaScript API for running any activity in offline mode Next topic Adjusting the performance of offline-enabled mobile apps