getPreferenceValue()

Returns the first preference value with the given key. If no preference values are associated with the key, or the backing preference store is not available, the specified default value is returned.

This function produces an error if the given key is null.

Syntax

portalLib.getPreferenceValue(
  key STRING in,
  defaultValue STRING? in)
returns (value STRING?)
key
A string value that indicates the name of the preference to be retrieved.
defaultValue
A string value that is used as a default if the preference cannot be retrieved. This value can be null.
value
A string that contains the value of the requested preference.

Example

preference String?;
preference = portalLib.getPreferenceValue("username", null);

Feedback