SetValueByID

Updates KeyName with Value in group GroupName, where the KeySet's ID matches the ID parameter. KeyName must exist in GroupName, otherwise an error is raised. The method returns the ID of the keyset that was updated or -1 if the keyset was not updated.
The KeySet ID can be retrieved with GetValue() (GetValue).

Note: There is currently no Update feature in the API for a whole KeySet (a row).

Syntax​

SetValueByID(GroupName: string, KeyName: string, Value: string, ID: integer): integer64

Note: This method is functionally equivalent to using SetValue with its Condition parameter set to "ID=ID".

Examples

In each of these examples, the object repoObject is deemed having been obtained through a call to the COM object "RepositoryLib.WorkflowRepository" (see Obtaining an instance of the Repository Object).

JavaScript

/* both methods perform the same task */
repoObject.SetValueByID("Users", "FormOfAddress", "Mr.", 10);
repoObject.SetValue("Users", "FormOfAddress", "Mr.", "ID=10" );

VB Script​​​

/* both methods perform the same task */
repoObject.SetValueByID "Users", "FormOfAddress", "Mr.", 10
repoObject.SetValue "Users", "FormOfAddress", "Mr.", "ID=10"

Updating a row

There is currently no 'update' feature in the API for a whole KeySet. This JavaScript example retrieves the KeySet ID, which is then used to update values in the row.

/* Get KeySet ID */
var repoObject = new ActiveXObject("RepositoryLib.WorkflowRepository");
var keySetID = repoObject.GetValue("customers", "ID", "CustomerID='CURD654321'");
/* Update Values */
repoObject.SetValueByID("customers", "FormOfAddress", "Mr.", keySetID);
repoObject.SetValueByID("customers", "Country", "US", keySetID);
repoObject.SetValueByID("customers", "Language", "EN", keySetID);