Namespace: DynamicData

DynamicData

Service for managing Transact Dynamic Data calls

Methods


DynamicData.call(serviceName, params, cancelPromise, disableValidate, serviceVersion, disableErrorAlert)

Retrieves dynamic data from a Journey Manager dynamic data service. Parameters can be passed to the service using the `params` object. Each key/value pair in that object will produce a parameter name and value. The value returned by the dynamic data service will be provided to the `then` function of the promise returned by this method.
Parameters:
Name Type Description
serviceName string The name of the dynamic data service defined in Journey Manager.
params Object An object of key-value pairs that is passed into the dynamic data service.
cancelPromise Promise A Promise that, when resolved, should abort the request.
disableValidate boolean If `true`, validation will be disabled. This is useful when calling this method from a validation rule (to prevent the data from being validated twice).
serviceVersion If specified, this version of the service will be used.
disableErrorAlert boolean If `true`, error messages will not be shown to the user.
Returns:
A promise of the result.
Type
Promise.<response>
Examples

Calling a service named "Greeting".

DynamicData.call("Greeting", {
		firstName: data.firstName,
		lastName: data.lastName
})
.then(function(response) {
		// Call was successful
})
.catch(function(error) {
		// Call was not successful
});

Show a progress indicator while calling a service.

Form.showProgress("Calling dynamic data service...");
DynamicData.call("Greeting", {
		firstName: data.firstName,
		lastName: data.lastName
})
.then(function(response) {
		// Call was successful
})
.catch(function(error) {
		// Call was not successful
})
.finally(function() {
		Form.showProgress();
});