You can expose SysSingleton.MiscSetting(setting:String):Boolean to let a Turnkey application request supported miscellaneous server operations, including the runtime CSS-generation scenario used by Theme as data.
Purpose
MiscSetting is an operation on SysSingleton, the root object of a Turnkey application. Turnkey looks for this operation when it is marked as externally late bound, allowing the Turnkey server to handle recognized setting requests.
Use this operation only for setting names that Turnkey recognizes. The available setting names are server-defined; an unrecognized name must not be assumed to have any effect.
Add the operation to your model
- Open your model in MDriven Designer.
- Locate the
SysSingletonclass. - Add an operation with this exact signature:
MiscSetting(setting:String):Boolean
- Set the operation's
Eco.ExternalLateBoundtagged value totrue. - Save and deploy the updated model to the Turnkey application.
The operation must have the exact name, one String parameter named setting, and a Boolean return type so that Turnkey can discover it.
Call the operation
Call the operation on the current SysSingleton instance from the part of your application that needs the supported server behavior.
For example, when your application changes the data object selected by SysSingleton.oclsingleton.PickedThemeData, call MiscSetting with the Turnkey-recognized setting name for CSS generation. This is the integration point that allows a theme stored as data to be regenerated at runtime.
Do not hard-code a setting name based only on this page: the recognized values are not documented here. Obtain the exact value from confirmed Turnkey documentation or support guidance before adding the call.
Use with Theme as data
Theme as data lets Turnkey obtain CSS from the object selected by SysSingleton.oclsingleton.PickedThemeData. The selected object must provide Name:String and DerivedCSS:String.
When you use MiscSetting for this scenario, also note these theme-specific constraints:
- A matching rule in
tkusercss.cssoverrides the CSS value held in the model. - During testing, you may need to update
web.config, restart the Turnkey site, and reload the page. - Check the names in the Turnkey
StylesInModeldialog to determine which theme variables affect the client.
Keep theme data and theme-selection logic on Theme as data. This page documents the SysSingleton.MiscSetting integration point.
Recognized setting values
The supplied documentation does not list the setting strings currently recognized by Turnkey. Do not infer them from the operation name or from unrelated server settings.
If you need to configure persistent, model-defined server behavior rather than request a miscellaneous operation, use SysMDrivenMiscSettingsSingleton where applicable. For example, that singleton documents settings such as global read-only mode, toolbar behavior, and the main UI engine.
Related SysSingleton features
MiscSetting is separate from optional properties that Turnkey fills on SysSingleton, such as client IP address, system type, and user agent. See SysSingleton optional properties for those properties and the OnCurrentUserChanged callback.
