USER_PREFERENCE_GET ()
USER_PREFERENCE_GET(PREFERENCE, [SCOPE]) |
Retrieves the value of a preference assigned to a USER.
You can create or modify preferences assigned to a USER by means of the FORMULA USER_PREFERENCE_SET ()
Input Parameters
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
PREFERENCE |
| Yes | Name of the preference requested | |
SCOPE | “PROGRAM” | No | Defines the scope for which the preference was defined. See PREFERENCE SCOPE |
Execution
Always. Calculated on-the-fly whenever an ITEM of a FORM is changed (by means of form_set_answer(), or when the FORM is opened
Examples
Formula | Description |
---|---|
USER_PREFERENCE_GET(“SHOW_HELP”) | Returns the value assigned to the preference named “SHOW_HELP” in the context of the PROGRAM where the FORMULA is executed |
USER_PREFERENCE_GET(“SHOW_HELP”, “USER”) | Returns the value assigned to the preference named “SHOW_HELP” as a global preference of the USER |
PREFERENCE SCOPE
Preferences are defined into a specific scope. Currently the accepted scopes are:
“PROGRAM” (default value): The preference is valid only in the context of the PROGRAM where the FORMULA is executed
“USER”: Global preference of the USER
For example, when the scope of the preference is set to “PROGRAM”, it means that if you have 2 different PROGRAMS that refer to the same preference name, the value returned will be different depending on the context where the FORMULA is executed.