Script Editor

Scripts can be created to perform a multitude of user-defined tasks at various levels across Ostendo such as:

 

1. System Action

 

With this type of script you can define specific actions that would take place prior to the linked screen being displayed.  This is useful, for example, to enable a User can look at selected data from the Item Master but cannot maintain that data. 

 

2. Standard

 

Adds the Script Name to the drop-down under ‘Custom’ on Ostendo’s top Toolbar.   Selecting this will run the Script. 

 

Examples of the types of script are:

Updating your existing system with information from Ostendo

Updating Ostendo with information from your existing system

Importing Supplier Catalogues

Send user-defined KPI information via email, or to a Mobile phone

 

3. Related

 

Add the Script Name to the drop-down Menu held against the ‘Related’ button within specific screens.  Examples could be as above with information specifically related to the current main screen

 

4.  Screen Data

 

This is related to Master, Order, Receiving, and Invoicing Screens where the action of Adding or Deleting a record or changing any field within the record will automatically run the Script to provide a resultant action.  For example

 

Zero Price Check on Sales Order Lines

Update Sell Price based on Last receipt Cost

In Purchasing check for best price from all Suppliers

Have a pop-up Sales Message appear

Specify a minimum order quantity

Show active Promotion when Sales Line Entered

 

5.  Order

 

This allows you to create a Script that is run against an Order as a whole in the following areas:

Assembly

Jobs

Sales

Purchase

POS

 

and enables you to add extra specific functionality such as:

Total Order Value discounting based on Order content

Freight calculations based on Order content

Order Authorisation Levels (Example: User Purchasing levels)

Order Margin Control with User-defined Margin levels

Order Validation and/or Checks

Workflow actions (Example: send Email regarding this Order)

Promotions (Example: 3 for price of 2, etc)

 

The Script can also be defined as ‘Mandatory’ in which case Picking, Receiving, Printing, etc is denied until the Script has been run

 

6.  Accounting Link

 

This type of script enables you to define links to other Financial Accounting Packages.  You can define scripts that will output in the appropriate format to suit the standards required by the receiving Accounting system

 

7.  Custom Data Screen

 

A Custom Data Screen enables a User to create Custom Screens that provide the following options

Display Types: The Screen itself can be Inquiry only, Data Entry only or a combined Inquiry/Data Entry

Data Entry Styles: You have the option to use a Computer Keyboard, Graphical Keyboard, Touch Screen, or Barcode Scanner.  All four can be utilised in the same Custom Data Screen.

Data Options: This can include Open format entry, validated against data within the Custom Data Script, or validated against Ostendo data.

Data Storage Options.  The data being entered can be held in temporary storage for ‘Batch Posting’ into Ostendo or posted immediately - a single record at a time.  If the data is held in temporary storage it can be held in non-Ostendo files and subsequently recalled into the data screen.

Upon creation of the first Custom Data Script and linking it to a Graphical Display Ostendo will create a new Menu Item under File called 'Custom Data Screens' from where they can be called by the User

 

8.  Web Service

 

A Web Service script allows access to applications via the internet, mobility devices, in addition to giving third party developers a way of interfacing their software products. The following can be achieved with Web Service scripts

Enable Ostendo to interface with other web enabled applications

Allow Ostendo Users (and their Customers / Suppliers) to seamlessly connect, inquire and enter information via the internet real time

Allow the use of mobility devices such as IPhones, IPads, Smart Phones & Tablets to interface real time with Ostendo

Provide a developers interface for third party software applications

Allow productivity tools (such as MS Excel spreadsheets) to connect real time with Ostendo

 

9.  Edit View

 

An Edit View Script is used in conjunction with the Edit View as generated via the User-Defined Table routine and applies the content of the script whenever records are being added or maintained to the User-Defined Table

 

10.  Before Report

 

Scripting can be used in the Report Layout Editor to control printing options such as printing fields under certain data conditions, etc.    The script is created here as a 'Before Report' style script which is then selected from a drop-down field in the Report Parameters screen

 

 

Entry and Display fields

 

List Tab

 

Script Name: Display only field showing the name of the script maintained via the ‘Detail’ panel.

 

Style: Display only field showing the Style of the script.  The displayed options are:

System Action

Standard

Related

Screen Data

Order

Accounting Link

Custom Data Screen

API

Edit View

Web Service

Before Report

 

Related Screen: Display only field showing the Screen for the Related script.

 

Category: Display only field showing the Category to which the script belongs as maintained via the ‘Detail’ panel.

 

Description: Display only field showing the Description of the script maintained via the ‘Detail’ panel.

 

 

 

Buttons

 

Close: This will close the Custom Menu Scripts screen.  If you have any unsaved data then you will be asked if you wish to save it before the screen is closed.

 

Add: This will go to the ‘Script’ panel for entry of a new Pascal Script

 

Save: Not applicable to the List panel

 

Cancel: Not applicable to the List panel

 

Delete: After confirmation this will delete the selected menu Custom Menu Script

 

 

Detail Tab

 

Script Name: Enter the name of the Script.  It is recommended that this does not contain spaces.  Therefore a script for Customer Check could be written as CustomerCheck.

 

(Radio Buttons): Select the Radio Button that defines where the Custom Script will appear.  The Options are:

All Users: If this is selected then this script is available for use by all non-administrator users.  Specific Users, however can be included/excluded from seeing this script through the normal Security Access Options held against the User.

(User) Only: This displays the name of the current User sign-on Name.  If this is selected then this script is only available to this User

 

Style: Selected the Script Style from the drop-down list.  Depending on the style selected other fields are presented as follows:

 

System Action Script

System Action: From the drop-down list select the Screen which this Action relates.

       : (Notes): A Notes field for entry of information about this Script

 

Standard Script

       : (Notes): A Notes field for entry of information about this Script

 

Related Script

Related Menu: From the drop-down list select the screen against which this Custom Script will be presented when the ‘Related’ button is pressed in that screen.

       : (Notes): A Notes field for entry of information about this Script

 

Screen Data Script

       : (Notes): A Notes field for entry of information about this Script

 

Order Script

Mandatory: If this is ‘checked’ then it denotes that the script MUST be run before the linked order can progress to the next step

       : (Notes): A Notes field for entry of information about this Script

 

Accounting Link Script

       : (Notes): A Notes field for entry of information about this Script

 

Custom Data Screen Script

Data Screen File: Click on the (...) Icon and point this script to its associated Graphic

'Edit' (Button): Click on this button to activate the Graphical Editor and, if you have already linked a Graphic, open up the Graphic

       : (Notes): A Notes field for entry of information about this Script

 

API Script

       This style script is just to prevent showing in the Custom menu, as an API call can also be done with a standard script if you intend for it to also be run via the Custom menu        

     : (Notes): A Notes field for entry of information about this Script

 

Edit View Script

       : (Notes): A Notes field for entry of information about this Script

 

Web Service Script

       : (Notes): A Notes field for entry of information about this Script

 

Before Report Script

       : (Notes): A Notes field for entry of information about this Script

 

Button (Download Online Template): This is only visible if you are creating a new Script.  When selected you can download a pre-defined script from the www.Ostendo.info website.  Of course you require access to the Internet to get the download.

 

 

Script Tab

 

Select a Script function: The drop-down list shows you all the current available scripting functions.  Simply select the required function and it will be placed in the main Script area at the cursor position.  This provides a quick entry of standard functions in addition to providing a guide to the function’s syntax

 

(script): This is where the script is created and maintained.  It is not the intention here to carry out detailed information on Pascal Scripting; for this see separate Tutorials. 

 

Here are a couple of simple scripts that may wish to try out this feature:

 

Example 1

begin

showmessage ('This is my test of Custom Scripts');

end.

 

You can test the script by clicking on the ‘Test Script’ button.  In this instance you should see a message box.  Upon saving the script as available to All Users you will see the Script Name appear under ‘Custom’ Menu on the top toolbar.  If you click on the Script Name then the script will be actioned.

 

Example 2

 

begin

executesql('update customermaster set ADDITIONALFIELD_1 = substring(Customer from 1 for 10)');

end.

 

This will copy the first 10 characters of the Customer Name to the first User Defined Field in the Customer record

 

Here is a Screen Data Script that may be used during Insert into the Customer table.  It checks if the entry contains a ‘&’ and, if so, rejects it.

 

begin
if pos('&',QueryValue('CUSTOMER')) > 0 then
begin
   MessageDlg('Please do not use && in Customer Name',mtinformation,mbok,0); //Note: the double && is just so it displays correctly in the message
   Abort;
end;
end.

 

Buttons

 

Close: This will close the Custom Menu Scripts screen.  If you have any unsaved data then you will be asked if you wish to save it before the screen is closed.

 

Add: This will present a blank ‘Script’ panel in readiness for creating a new Script

 

Save: This will save the current dates without exiting the screen

 

Cancel: Any changes made to a date since the last time the ‘Save’ Button was pressed will be lost and the dates will revert to it’s pre-change position.

 

Delete: Not applicable to the ‘Script’ panel

 

Test Script: Clicking on this button will run the entered script.