SBM JavaScript Library Guide → Reference → Field Methods → SetFieldValue
Sets the value of the specified field.
Name | Type | Description |
---|---|---|
fieldName | String | The name of the field. |
value | Various |
The value to set on the field. The value is a string, with the
following exceptions:
If the field is a Multi-Group, Multi-Relational, Multi-Selection, or Multi-User field, the value is a string of comma-separated values. If the values have embedded commas, use the SetFieldValues method instead to return the array. In Modern Forms, the following input types are also accepted for
Single- and
Multi-
Group,
Relational,
Selection, and
User fields:
Note: Automatic searches performed by
SetFieldValue may experience limitations with
max search results or complex VDF. When possible, try to use name/value pairs
when setting a searchable field, as any desired values that are already present
or that can be constructed will be selected without searching.
|
fireEvent | Boolean | If this parameter is set to true, then setting the values causes the change event to fire. If this parameter is set to false, then the change event does not fire. |
Result | Value |
---|---|
(none) |
This example sets the string value of a Text field:
SetFieldValue("UNITPRICE", "1.45", true);
This example sets the string value of a Binary/Trinary field with three radio button choices:
SetFieldValue("RELEASETYPE", "Beta", true);
This Modern Form example sets the value of a searchable Single Relational field (e.g. copied from another field referencing the same table). The value is inserted if necessary:
SetFieldValue("RELEASE", { name: "SBM 11.3", value: 12345 }, true);
(none)
Copyright © 2007–2018 Serena Software, Inc., a Micro Focus company. All rights reserved.