Home ›  Tap Forms Pro ›  Script Library ›  configHandler ▾ 

Category: Script Library

configHandler

tagHandler is a script designed for persistent variable storage across different scripts within a single TapForms Pro document.

When an instance of this class is created, the configHandler loads all variables associated with the specified domain to optimize record searching. Variables can be accessed and modified using get and set methods. When a new variable is stored, a new configuration record is created, and the local data copy is updated.

By default, all variables are stored in the form named Config.

Usage

This script is a helper script that is launched from other applications. It doesn't do anything on it's own.

To use this class, first it needs to be loaded:

// load tagHandler class if it is not already loaded
if (typeof configHandler === 'undefined')
    document.getFormNamed('Scripts').runScriptNamed('configHandler');
  • new configHandler('domain'): Creates a new configHandler class in the given domain.
cfgCRM = new configHandler('CRM');
  • cfg.set('name', value): Stores value in variable name and updates the persistent storage accordingly.
cfg.set('string', 'The quick brown fox jumps over the lazy dog'); // string type
cfg.set('integer', 1234); // integer type
cfg.set('object', {"a": "a entry", "b": "b entry"}); // object type
cfg.set('array', ['alpha', 'beta', 'gamma']); // array type
  • get: Returns the value stored in the variable name.
console.log(cfg.get('string'));    // get string type
console.log(cfg.get('integer')); // get integer type
console.log(JSON.stringify(cfg.get('object'))); // get object type
console.log(JSON.stringify(cfg.get('array'))); // get array type

Concurrent access to the same domain from different applications leads to unpredictable behavior.

Installation

The configHandler script is installed using the scriptHandler script about which you can learn more over here. It is installed in the Scripts form.

Dependencies

none

ChangeLog

Link to ChangeLog

Author


Do you like this script? Are you using it? Please consider supporting me by buying me a coffee!

Buy Me Coffee Link

Thanks!


Last modified: Apr 24, 2025 6:25:03 PM


Tap Forms Consulting

Do you need help writing scripts for your Tap Forms Pro database? I'm happy to help you. Contact me to discuss your idea or project.


Web Design Consulting

Do you need help designing your web site or getting Backlight working the way you want? Contact me to discuss your needs.


Buy me a Coffee

If you like what I share here, please consider buying me a coffee or a print. This helps keeping me motivated to continue posting. Thank you!

Buy Me A Coffee