setValue (Client API reference)

Sets the data value for a column.

Column types supported

All

Syntax

formContext.getAttribute(arg).setValue(value)

Parameters

Depends on the type of column.

Column Type Parameters Type
boolean Boolean
datetime Date

In Unified Interface, date values are assumed to be UTC.
In the legacy web client, date values are assumed to be in the user's time zone.
decimal Number
double Number
Integer Number
lookup Array An array of lookup objects.

Certain lookups, known as 'partylist' lookups, allow for multiple records to be associated in a lookup, such as the To: column for an email table record. Therefore, all lookup data values use an array of lookup objects – even when the lookup column doesn't support more than one record reference to be added.

Each lookup has the following properties:
- entityType: String. The name of the table displayed in the lookup.
- id: String: The string representation of the GUID value for the record displayed in the lookup. The value should match the following format: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
- name: String: The text representing the record to be displayed in the lookup.
memo String
money Number
choice Number
string String
memo String
money Number
choice, choices Number

The getOptions method returns option values as strings. You must use parseInt to convert them to numbers before you can use those values to set the value of a choice column. Valid statuscode (Status Reason) options depend on the current statecode of the record. The statecode (Status) column can't be set in form scripts. To understand which statecode values are valid, refer to the column definitions. For custom tables, use the table definitions browser. Finally, also consider any custom state transitions that have been applied to the column. More information: Define status reason transitions for the Case or custom tables.
String String

A String column with the email format requires that the string represents a valid email address.

Note

Updating a column using setValue will not cause the OnChange event handlers to run. If you want the OnChange event handlers to run you must use fireOnChange in addition to setValue.

Related article

getValue (Client API reference)