Field GetDisplayValue() Method

Gets the current value of this field, reflecting any changes that may have been made since the last database Update().

Function Signature

 string GetDisplayValue( [bool checkPrivs [, string format]] )

void GetDisplayValue( Variant& val, [bool checkPrivs [, string format]] )

Parameters

Parameter Type Description

checkPrivs

bool

Optional. Defaults to true if omitted. If true, the value will only be supplied if the current user has sufficient privileges to see this field.

format

string

Optional. For File or URL fields, the value "json" indicates that the output should be a JSON string value.

val

Variant&

(Output) This field's current value as a formatted string.

Return

Type Description

string

The field's current value as a formatted string.

Technical Details

SBM ModScript version: 11.3. Extended in 11.4.

Notes

This is the display value as shown on the browser, and not the internal value stored in the database. For example, for a selection field, the value of the selection (None) is 0 in the database. This function will return the string (None), while GetValue and GetDbValue will return 0. To get the value most recently stored in the database, use the method GetDbValue(). If this field comes from an item that was directly read out of the database and you wish to use checkPrivs, you must call the ApplyProjectStateOverrides() VarFieldList method.

Related Topics

Field