Script Editor
In the Script Editor, C# or VB scripts can be created to achieve additional changes, behaviours, or functionality to a template when generated. This is where you can add any behaviour that Bizview normally does not handle! These scripts are then connected to the template in the Scripts worksheet properties tab and executed accordingly. The Scripts in the Script Editor can be written in C# or VB.
Since the knowledge about how to write these scripts depend on your C# / VB skills, we will only explain the user interface and the features available to you. For examples and additional help on how to write scripts, please contact NCG Support.
Access the Script editor by selecting System Administration > Templates > Designer tools > Script editor.
To write a new script, select the New button in the ribbon. An empty script displays and you are free to start writing the script.
This topic contains the following sections:
Ribbon
Below is a list of buttons available in the Script ribbon:
Button | Description | Note |
---|---|---|
New | Opens a new empty script template. | |
Open | Open an existing script. | |
Save | Save script. | |
Save as | Save as with new name. | |
Delete | Delete current script. | |
Build | Build and verify the script (Compile). | Verifies that the code is valid (see Additional Information). |
Language | Choose language. | C# or VB. |
Generate document | Generate a document to test the script. | Used together with impersonation. |
Link to template | Attach current script to Template(s). | (see Additional Information). |
User | Test the script with $User. | Impersonation enables you to the script behaviour depending on the User chosen. |
Client | Test the script with $Client. | Impersonation enables you to the script behaviour depending on the Client chosen. |
Choose snippet | Choose among commonly used code snippets available to you. | (see Additional Information). |
Vertical view | Arrange the windows vertically. | |
Horizontal view | Arrange the windows horizontally. |
Additional Information
Build: Compile the current script to check for errors. An error log is presented in the bottom including the row number for the error.
Link to template: To be able to use a script in a template, you need to link the script to the template. If not, the script will not be available for use in the Script tab in template properties.
Code snippet: When selecting a Code snippet, the code is copied to the clip board. Place the cursor in the script and select paste to insert the Code snippet.
Usage
The script(s) that are defined in the solution, can be attached to template(s) for execution in connection to generating a template. In the Scripts properties tab of any template design, you can setup the properties for running a script. See details in template design.