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.
portalLib.getPreferenceValue(
key STRING in,
defaultValue STRING? in)
returns (value STRING?)
preference String?;
preference = portalLib.getPreferenceValue("username", null);