Limitations When Using the setValue() Method

The setValue() method is not supported for the following types of field:

  • Analytics fields

  • Color fields (that is, fields used for color definitions in themes)

  • Currency code fields

  • Multi-association fields

  • Shared address fields

  • Single-association fields for which the Auto-Resolve Enabled check box is deselected. Such fields are grayed out on the UI.

If you call setValue() for the above field types, null is returned.

Single-association fields and fields such as Sales Stage (on Opportunity) only support setting by row ID on Detail pages.

Concatenated fields are not supported, but you can set the values for constituent fields of concatenated fields for both Detail and Edit pages, regardless of whether the fields are on the page layout.

For a check box field, only the values Y or N are accepted for the input parameter. Any other values are ignored.