Skip to main content
Version: 2.2.0

Edits the value of a workflow form list-of-values field

To edit the value of a list-of-values field contained in a workflow form, use the setEntityRelationshipValue method and enter the following parameters: ID # of the entity to which the form belongs, ID # of the relationship with the list-of-values entity, and an array containing the attribute ID # and the value. The system uses the value to fetch the corresponding record code.

If there is a possibility of repeated values on the list, enter more than one attribute to break the tie. For example, when the value "Jordan" is selected from the "user" list of values, if there are two "Jordan" records, the system will not know which one to select. In this case, in addition to the name, another value must be entered, such as user ID.

Here is the syntax of the method:

setEntityRelationshipValue("Entity ID #", "Relationship ID #", "Array with list entity attribute ID # and value)

Examples:​

First example​

$workflow_api->setEntityRelationshipValue("ENT01", "RelationshipID",
array("nmtext" => "Value 1"));

Second example​

$workflow_api->setEntityRelationshipValue("ENT01", "RelationshipID",
array("nmtext"=>"Value 1","nmmat"=>"789"));

In the first example, the setEntityRelationshipValue method is updating the value of the relationship identified as "RelationshipID" in the entity identified as "ENT01" to "Value 1". In the second example, in addition to the value "Value 1", the user ID value "789" is provided to prevent ambiguity if there is more than one "Value 1" on the list of values.