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  
Print 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:

  • Field properties

    This lets you define field attributes, behavior and values.

  • Sample Code window

  • VBS Modules Window

  • Callout functions window

  • Project References window

    This lets you add a reference to the script.

  • Errors and warnings window

  • Notepad

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.

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.