setPicklistColumn()
The setPicklistColumn() function (client-sides) changes the reference column associated with a popup table or a popup list (formerly called a picklist and a picklist dropbox) for the current configuration session. The reference column belongs to a product table and provides the data that's saved in the field. If users reload the product interface, the reference column reverts to the value defined in the answer record. For more information about popup tables and popup lists, see Working with Popup Table and Popup List Answers.
Syntax
Use this syntax for the setPicklistColumn() function:
setPicklistColumn('QUESTION_CODE', 'ANSWER_CODE', 'referenceColumn');
Return Value
The setPicklistColumn() function returns undefined.
Parameters
All parameters are required.
The setPicklistColumn() function accepts the following parameters:
-
QUESTION_CODE(string) - Specifies the code of the input box or qTable question associated with the popup table or popup list answer. You can find the code in the Code field on the question record. -
ANSWER_CODE(string) - Specifies the code of the answer for the popup table or popup list. You can find the code in the Code field on the answer record. -
referenceColumn- Specifies the name of product table column that provides the data that's saved in the field.
Examples
The following examples show how to use the setPicklistColumn() function.
Changing the Reference Column for a Popup Table
Suppose you have a popup table for desk accessories and the ID column is selected as the reference column on the answer record. This example changes the reference column to the column containing the accessory names for the current configuration session.
setPicklistColumn('ACCESSORIES', 'POPUP_TABLE', 'Name');