Custom Scripting - Overview
Custom scripting allows extension of the functionality of the software at certain key points or trigger actions. This is accomplished through custom scripts - which are either single scripts or script projects (multiple scripts running together as a whole).
Within the scripting environment a scripting author has access to many common Pascal and/or VBScript-type procedures/functions. A common example would be an event script that occurs on the 'Event Finish' trigger action. The script might check various conditions in the event, compare it to other data in the database, then if certain conditions are met the user is blocked from proceeding with completion of the event.
Essentially custom scripting follows the same flow of execution as Workflow Configuration except it provides more microscopic access to the various points of execution within the event model, allowing for more granular control or finessing of events. Essentially when a task cannot be accomplished using the wealth of tools within Workflow Configuration, IndySoft may determine custom scripting is the best solution to accomplish a workflow requirement.
Because of the potential for volatile actions in custom scripting, the need for a programming background, and the level of knowledge about the overall system that is required, access to the software is regulated to IndySoft Services Staff. It is not supported under the support contract offering, and is not available to end customers for purchase.
Temporary access to custom scripting during installation and troubleshooting efforts is controlled through a 'response code' that must be input before any scripting can be initially launched within an IndySoft session. Closing of the scripting environment session will require a new response code to regain access.
Response codes can only be provided by an IndySoft Service or Support Technician to assist in troubleshooting scripted functionality in the product.
To provide an interface into the core IndySoft system the scripting environment exposes dozens of IndySoft procedures/functions. These procedures/functions expose key points of functionality to the scripting environment, i.e. returning a field value, setting a field value, refreshing a screen, returning login details, etc.
Single-file scripts have been a staple of the event system in IndySoft for several versions (less common login scripts were introduced in version 8x) - and this concept continues in version 9x and above. In addition to event-level scripting there 6 different types of scripting:
There are 6 different types of scripting that will be described in the topics that follow:
·Event Scripts - provide access to event fields/details, trigger at various point during the event wizard
·Equipment Scripts - provide access to equipment fields/details, trigger at various points during equipment modification on main screen
·Template Scripts - provide access to template fields/details, trigger at various points during template modification on Template Editor
·Order System Scripts - provide access to order system fields/details (estimate, work order, invoices), trigger at various points during order system usage
·Login Scripts - provide access to to current login scenario, trigger upon change of password at login or user edit within Profile Manager
·Alarm Scripts - provide access to core scripting functions, used to assemble complex breakout scripts, trigger upon launch of alarms. These scripts are NOT stored to the database, but reside as files in the IndySoft program directory, named by the matching alarm.
Each of the types of scripts contain a different set of core IndySoft procedures/functions specific to that type of functionality. All scripting types also include access to a core IndySoft library of procedures/functions that provide access to common software functionality, details, and generic database access (hooks into the database that automatically follow the Database Connectivity setup in Database Settings).
There are 4 types of libraries you can reference for available functions:
1. Pascal-Library Custom Scripting Functions - this is a Pascal-like library of common procedures/functions that is available to all scripting types.
2. VBScript-Library Custom Scripting Functions - this is a VBScript-like library of common procedures/functions that is available to all scripting types.
3. Common IndySoft Procedures/Functions - these generic procedures/functions are also available in all scripting types. These procedures/functions provide quick access to IndySoft functionality.
4. The library of procedures/functions that is specific to the script type. The final set of procedures/functions that is available depends upon the type of script, so for Event scripts, for example, the Event Scripts procedures/functions are also available. For Equipment scripts the Equipment Scripts procedures/functions are available, etc.
Single-file scripts always follow VBScript syntax, in terms of structure, i.e. if...then, while loops, etc. But there are dozens of more Pascal-like procedures functions that are also available as a convenience, i.e. DateToStr, FormatFloat, etc. Project-based scripts are even more flexible - when the project is created the core scripting-style is chosen: either VBScript or Pascal. Either way, the same IndySoft core procedures/functions are available - just select whichever scripting style is most familiar.
Finally, the IndySoft Project Editor is available for all scripting types (with the exception of Alarm Scripts) - and allows for even more advanced scripting that includes form design and integrated debugging.
Before proceeding, please see Precautionary Statement.
Productivity Tip
Use the Script Review Utility (ScriptReview.exe) to quickly review and edit single-file scripts.
