Using validation functions

To make the transition from older versions of the system easier, you can use the following functions available in Administration in the Service Console:

Available since version 5.7.33

Finding uses for global scripts within calculations

To find the usage of a specific script from global scripts within calculations, you can use the functions mentioned below in the Service Console .

sys. findScriptImportsInCalculations();

An empty first parameter searches all templates in the environment.

sys.findScriptImportsInCalculations(1626);

With a given template ID, it searches and returns tasks only from that template.

In the result, you can then click directly on a specific template or task:

Finding a specific function or text within scripts

To search for any string within global scripts, you can use the functions mentioned below in the Service Console .

sys. findInScripts('result.data.split');

Finds where the result.data.split notation is used

Alternatively, you can use regex, for example:

sys. findInScripts(/\bvar\s+approverArray\s*=\s*JSON\.parse\s*\(/)

Just enter into AI that you require RegExp notation for the sys.findInScripts(); function.

Find a specific function or text within calculations

To find any string within calculations, you can use the functions mentioned below in the Service Console .

sys. findInCalculations('sortedTaskActual', 27);

Finds usage of sortedTaskActual within template ID 27.

sys. findInCalculations('sortedTaskActual');

Using the function without specifying a template will find usage of sortedTaskActual in all templates.

Alternatively, you can use regex, for example:

sys. findInScripts(/\bvar\s+approverArray\s*=\s*JSON\.parse\s*\(/)

Just enter in AI that you require RegExp notation for the sys.findInCalculations(); function.

Find a specific function or text within dynamic conditions and dynamic rows

sys.findInConditions('test');

Finds the use of the string t est within all dynamic conditions and dynamic lines (script)

Finding unsupported features (lodash and other deprecated features)

A detailed description of how to upgrade lodash can be found here . This is available in version 5.3.

sys. validateTemplate(tprocId: number);

Searches a specific template and returns all occurrences of unsupported functions. It scans:

  • Calculations
  • Dynamic conditions
  • Dynamic rows
  • Print templates

It also looks for any broken scripts! You can then use the sys.fixTemplateIssues(); function to automatically fix them.

sys.validateTemplates ();

Scans all templates in the same way as sys.validateTemplate above.

sys. validateGlobalScripts();

The function will perform a check in global scripts (Calculations, CO React, CO)

sys. replaceDeprecatedLodashUsage();

Function for automatic replacement of unsupported Lodash functions. If the parameter is empty, it will perform the replacement in all templates. If the template ID is filled in, it will perform the replacement only there. It automatically performs the replacement in calculations, dyn. conditions and in dynamic rows, but also in scripts. It will automatically overwrite the unsupported notation _.find, see Lodash Upgrade

Frantisek Brych Updated by Frantisek Brych

Main changes and deprecated features (v5.3 > v5.7)

Contact

Syca (opens in a new tab)

Powered by HelpDocs (opens in a new tab)