Skip to end of banner
Go to start of banner

lfAllowSelectOptions

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Current »

Availability

This routine is available starting with Power Scripts™ v3.0.2 (server) and above.

Supported Custom Fields

Please note that this routine can only be used with a single select custom field. If you wish to use this kind of functionality with cascading select list, consider using a custom cascading select field found in this tutorial: Create custom cascading select field.

Syntax

lfAllowSelectOptions(field, options[, triggerChange])

Description

Restricts a field's selectable values to the list of options given as a parameter of the routine.

Parameters

ParameterTypeRequiredDescription
fieldstringYesField to restrict options for
options

string[]

YesList of remaining options
triggerChangeBooleanNoIf set to "true", it triggers the change event on the field when a routine is used

Example - restricting users to select certain values in the field options

lfAllowSelectOptions("priority", {"Medium", "High"}); 
//where field = "priority" and options = "Medium" and "High"


If you want to trigger the change event on the field when using the lfAllowSelectOptions routine, you can use the optional triggerChange parameter set to true:

lfAllowSelectOptions("customfield_10000", {"option1", "option2"}, true); 
//where field = "customfield_10000" of type select list, options = "option1" and "option2" and triggerChange = true

See also

  • No labels