• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Edit
Show / Hide Table of Contents

Get the current value of a given preference

Some tooltip text!
• 1 minute to read
 • 1 minute to read

The SetPreference method has four overloads depending on the value passed (string, int, bool, or DateTime). The SoPreference class provides four corresponding methods to retrieve the current value of a given preference.

using SuperOffice;
using SuperOffice.Data;
using(SoSession mySession = SoSession.Authenticate("sam", "sam"))
{
  bool value = SoPreference.GetBool("Visual", "SundayFirstDay", false);
}

The example above retrieves whether the calendar for the signed-in user begins with Sunday or Monday. In this case, since GetBool() requires 3 parameters, the default value of the key should also be passed in. The default value parameter should be passed in only when using the GetBool method.

See also: intro to cache

In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top