You can add user and system custom settings to TeamConnect using the API. When you add a custom setting, you can enter custom code so that the setting works throughout TeamConnect.
To add custom settings, use the setSystemSetting() and setUserSetting() methods that receive the custom setting name parameter. Even though custom setting values save as String values, you can convert the setting to another data type as part of the code.
For example, if you want to create a new user setting with the New Custom Setting key, use the following code:
// Adds a new custom setting to the system. // Making the same call after the setting is initially added updates the value like it does for non-custom settings. platform.getSettingsService().setSystemSetting("New Custom Setting", "10"); // Setting values save as a String, so you can convert the String to an Integer or another data type. // You can enter custom code to check the value of the newly added setting and impact parts of TeamConnect. if(Integer.valueOf(platform.getSettingsService().getSystemSetting("newCustomSetting")) > 5) { // Custom code here } |
Note: If New Custom Setting already exists when you enter the previous code, the setting updates with the new value.