Script Editor
You use this program to maintain C# and VBScripts. These are simple text files that can be edited using the SYSPRO Script Editor program or any text editor.
Toolbar and menu
Field | Description |
---|---|
File | |
This prints the script. | |
Print Preview | This lets you view the document before printing it. |
Delete VBScript / Delete C# code |
This deletes the data record currently displayed. |
Exit |
This exits the program. |
Edit |
This menu contains all the standard editing tools, such as Undo, Redo, Cut, Copy, etc. |
Comment section |
This adds comment markers to the selected code. |
Uncomment section |
This removes the comment markers from the selected code. |
Options | |
Show Line Numbering | This displays the line numbers in the script pane. |
Show selection Margin | This displays a margin on the left hand side of the script pane that can be used to select lines. |
Highlight Current Row | This highlights the row where the cursor is located. |
Enable Virtual Space | This lets you position comments at a consistent point next to your text or code. |
Script Timeout | |
Markup Editor | This lets you modify XAML code using the XAML editor |
Save | This saves your changes. |
Save for Debug |
This option compiles the code to be ready for debugging. This is only available for scripts written using C#. |
Events | This lets you select the event for which you want to |
Field Events | This indicates the field on the form or toolbar to which you are applying a Field event. |
On Menu Select | |
Form Events | This indicates the form to which you are applying a Form event. |
Toolbar Events |
Toolbar indicates that you are defining a script for a toolbar entry. |
Syntax Check |
This checks the syntax of the script and refreshes the Procedures list. IF the compiler finds any errors, a list of errors is displayed in the Description bar below the script. |
Prettify Code |
This will format the code to an acceptable standard, making the code more readable and easy to understand. |
Procedures | This lets you enter or select a procedure that you want to find in the script. |
Code Generation | This combines various existing functions (e.g. call business objects, send push notifications, execute workflows, launch programs, and customize toolbar buttons). |
View |
This lets you view the following panes:
|
Language |
This lets you select the language in which you want to create the script. When opened within a program that contains an existing script, the language in which the script was created, is displayed. If you select VBScript, the VB Script tab will be displayed and depending on your selections, the system creates some of the VB script for you. If you select C#, the C# tab will be displayed and depending on your selections, the system creates some C# code for you. If no script exists for the program, the C# tab is displayed and the system defaults to C# at the Language tool. If a VB script exists for the program, it will be displayed on the VB Script tab and VB Script is displayed at the Language tool. |
Field Properties
This pane is docked together with the Variables pane on the right-hand side of the screen (but can re-positioned as required).
Variables
This pane is docked together with the Field Properties pane on the right-hand side of the screen (but can re-positioned as required).
On this pane you can access the Events hyperlink to quickly insert a field-level event.



The C# programming language supports the use of references, which becomes especially useful when an assembly is utilized for functions required by multiple scripts. Script references enable common code to be written and compiled into a .dll assembly file, allowing other projects to access and use this shared logic. This facilitates multiple programs to leverage common functionality efficiently.
References have two key points of information:
-
Namespaces
This is a list of namespaces provided within the assembly reference and each namespace is vital to accessing certain pieces of code within the assembly.
For example:
Double click on the namespace in the ReferencesListview to add a using statement for the namespace.
-
References
These sub-references under the parent assembly (also known as dependencies) are sometimes vital to the methods of the parent. Whilst not always required, it can be beneficial to add these into the reference list.

The following two types of references offered within SYSPRO scripting:
Local references:
-
These are references that are accessible within a single script instance, i.e. per executing script.
-
There can be a maximum of 20 of these per script.
-
These are saved in the AdmScriptDetail table per record.
Global references:
-
These are references that are accessible across any and all script instances.
-
These are saved in the AdmScriptReference table.

Follow these steps to add a reference:
-
Navigate to the Script Editor.
-
In the Script window, select C# at the Language tool.
This ensures that you are working with a C# script.
-
Click on View and select Project References Window.
The Project References pane is displayed.
-
Select Add.
-
Browse and select the dll you need.
The dll is loaded into the listview.
-
You now have the option to save the reference as a global assembly. This will store it so that it is available to all scripts.
When saving, the assemblies are validated, marked as Saved to database and information is populated regarding their namespaces and sub-references.
-
You can double click on a namespace to insert it at the top of your code.

SYSPRO provides the following common references to each script. These are displayed in a blue color in the Project Referenceslistview.
-
SYSPROSA_ScriptCommon.dll
Provides common functionality to all scripts
-
SYSPROSA_ScriptingRuntimeProcess.dll
Required by SYSPROSA_ScriptCommon.dll
-
Microsoft.Data.SqlClient.dll
Provides SQL functionality to scripts
-
Microsoft.Identity.Client.dll
Required by Microsoft.Data.SqlClient.dll
-
System.Security.Permissions.dll
Required by Microsoft.Data.SqlClient.dll
-
System.Management.dll
Provides Win32 functionality to scripts and is required by the diagnostics script (IMPMENYY).

References often contain dependencies to other assemblies. In order to access the namespaces of the parent assembly, it is often required to add the dependencies as well. This ensures that the assembly is loaded correctly so that the namespaces can be accessed.
You can try adding a few of the key dependencies onto the reference list.


The main syntax differences between C# and VBScript in SYSPRO scripting are:
-
Case Sensitivity
VBScript is case-insensitive, meaning variables, functions, and routines can be written in any case and referenced in a different case.
C# is case-sensitive, so functions, variables, and routines must be written and referenced in the same case.
-
Return Types
In VBScript, certain functions can return values to alter their effects, such as returning false to cancel a change. While this concept remains in C#, the return syntax differs.
For example:
A function in C# might use a Boolean return type to allow or disallow changes based on specific conditions.

In VBScript, variables are often appended with the CodeObject instance to access runtime variables, whereas in C#, Variables are accessed directly without the CodeObject instance.
This table shows the differences:
Script caption/type | Code injection (VBScript) | Code injection (C#) |
---|---|---|
Any panes fields |
{PaneName}.CodeObject.{FieldName} |
Panes.{Pane name}.{FieldName} |
Listview (array in) |
{Listview name}.CodeObject.Array |
Panes.{Listview name}.Array |
Listview (array out) |
{Listview name}_OUT.CodeObject.Array |
Panes.{Listview name}_OUT.Array |
CustomPane variables |
CustomizedPane.CodeObject.{VariableName} |
CustomizedPane.{VariableName} |
CustomPanes variables |
CustomizedPanes.CodeObject.{CustomPaneName} |
CustomizedPanes.{CustomPaneName} |
eSignature variables |
eSignature.CodeObject.{VariableName} |
eSignatures.{VariableName} |
Flowgraph variables |
Flowgraph.CodeObject.{VariableName} |
Flowgraph.{VariableName} |
Workflow variables |
WorkflowVariables.CodeObject.{VariableName} |
WorkflowVariables.{VariableName} |
Tile variables |
Tile.CodeObject.{VariableName} |
Tile.{VariableName} |
System variables |
SystemVariables.CodeObject.{VariableName} |
SystemVariables.{VariableName} |

Arrays in C# scripting work differently from standard .NET arrays and VBScript arrays.
-
VBScript arrays were indexed by column and then row, which has been changed in C# to row and then column indexing.
-
In C#, arrays are accessible within a class called TwoDimensionalArray with the following methods and/or accessors:
Accessor Method Getter:
Array[row, col]
var myCell = CustomizedPane.Array[0,0];
Setter:
Array[row,col] = {value}
Panes.Movements.Array[0,1] = “New value”;
Upper bound:
Array.GetUpperBound(dimension)
CustomizedPane.Array.GetUpperBound(0);
Lower bound:
Array.GetLowerBound(dimension)
Panes.Movements.Array.GetLowerBound(0);
Get .NET 2d array:
Array.GetBaseArray()
Panes.Movements.GetBaseArray();
Returns object[,] of list view values. This can allow you to use standard array routines not accessible under this class.

The code setup for C# requires a namespace, class name, and inheritance, which are set up by default when creating a new script and can't be changed.
This ensures that the script adheres to the required C# syntax and can be executed without errors.


Take note of the following when creating C# scripts using the Script Editor:
-
The default code structure provided by the syntax editor must be left unchanged.
-
Any new functions added must be placed within the innermost curly braces {} of the class structure.
-
The script must adhere to C# syntax, and any errors will be displayed in the Errors and warningslistview.
-
Code injection must be followed correctly by double-clicking on an item in the Variableslistview.

C# scripts follow the same execution hierarchy as VBscripts, which is as follows:
-
Role script
-
Industry script
-
System-wide script
-
Company script
-
Operator script
-
Global script

The following system-wide database tables store script information:
The AdmScriptDetail table stores the base-64 encoded contents of scripts.
The AdmScriptReference store the base-64 encoded contents of .dll assemblies.


-
Navigate to the Script Editor.
-
Select the script language from the Language control on the toolbar.
-
Existing VB scripts will become obsolete and uneditable once you create a script in C# for the program. When you delete the C# code, the VB script becomes editable again.
-
The old script (i.e. the script in the previous language) is only available while the script editor is still open. Once the script editor is closed, the content of the old script will be lost.

The VBScript limit of 200,000 characters has been removed for C# scripts. However, we recommend not to exceed the original limit, to ensure that results are responsive and efficient.

-
Disclaimer: VBScript-to-C# conversion is not guaranteed. While we use AI-assisted tools to convert existing VBScript code into C#, successful conversion is not assured. Users must be trained in C# scripting and are responsible for reviewing and testing the converted scripts before use.
-
C# scripting doesn't support script timeouts. Unlike VBScript, forcibly terminating a running C# script is unsafe and may lead to unpredictable behavior.
If absolutely necessary, users can manually end the SYSPROSA_ScriptingRuntimeProcess.exe using the Task Manager, though this is strongly discouraged.
-
C# reference assemblies can't be written from within SYSPRO.
We don't support creating C# reference assemblies. These must be created using external software. We strongly recommend that these assemblies be compiled using the AnyCPU configuration in order to support possible future scripting enhancements.
-
Script variables and Instances
C# compilations are treated as scripts, meaning variables and instances are cleared on each new run. For global variables, use SystemVariables.GlobalVariable1-4 or the SET-VARIABLE and GET-VARIABLE callout functions.
-
Script Language Changes
The existing script will be overwritten when changing the scripting language of tiles, flowgraphs, and Application Designer scripts.
The old script (i.e. the script in the previous language) is only available while the script editor is still open. Once the script editor is closed, the content of the old script will be lost.
Program access
-
You can access this program from within forms, panes and toolbars in SYSPRO by right clicking in the pane and selecting the Macro for: option.
Alternatively, you can select the Edit VBScript function from the Customized Pane Editor program.
Activity considerations
-
Operator access to the following activities within this program can be restricted. You configure this using the Operators program.
Activity Description VBScript editing Controls whether an operator can edit VBScripts or change customized panes. It also controls whether an operator can access the Visual Designer program (displayed from the submenu of the gear icon). This does not apply to importing customized panes, which is controlled by the Allow to import customized panes activity.
Copyright © 2025 SYSPRO PTY Ltd.