setField


Purpose

Sets a value for the key in the selected account data scope (either public or private).

If the key does not exist, it is created. If it exists, its value is overwritten.

Signature

setField( scope, key, value, callback )

Returns

This method does not return anything.

Parameters

Name Description Type Use
scope Specifies whether the data lays within the public or private scope of the account. string required 
key Identifies the exact data item that is created or updated by the setField operation. string required 
value Represents the exact value that is set for the given key. string required 
callback Passed while sending a reply to the request referring to a field. object required

Callback structure

The Field object's callback can be structured as follows:

{
	onFailure: function(error) { ... },
	onSuccess: function() { ... }
}

Methods

Name Description Return type
onFailure

Indicates that a request referring to a field was not processed.

undefined
onSuccess

Indicates that a request referring to a field was successfully processed.

undefined

Related topics

Public API reference
AccountManager
Legal notice | Copyright © 2017 and Confidential to Pegasystems Inc. All rights reserved
PDN | Feedback
Advanced...