Main Menu Script


Adds the Script Name to the drop-down under ‘Custom’ on Ostendo’s main menu.  Selecting this will run the Script.  This style of Script can be:

Available to all

Restricted to Administrator

Restricted to specific Users

 

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

 

To see how this works you can try the following exercise in which we will get an existing Job that was inadvertently created as an Order and we want to change the status to ‘Quote’.

 

Go into File>Custom Scripts and add a new Custom Script called (say) Job Quote.  ‘Check’ the ‘All Users’ radio button to make this script available to all users.  In the ‘Script’ tab enter the following:

 

var

TheJobNumber: String;

TheCurrentStatus: String;

AreYouSure: String;

begin

TheJobNumber := AskMandatoryQuestionWithLookup('Job Number','Select Job Number',1075);

TheCurrentStatus := GetStringFromTable('JOBHEADER','ORDERSTATUS','ORDERNUMBER',TheJobNumber);

AreYouSure := AskQuestion('Confirm this is the Job','TEXT','Are you sure you wish to change ' + TheJobNumber + ' to a Quote','[d]Yes,No');

if AreYouSure = 'Yes' then

  begin

   executeSQL('update JobHeader set OrderStatus = ''Quote'' where OrderNumber = ''' + TheJobNumber + '''');

   executeSQL('delete from OrderRequirements where DemandOrderType = ''Job'' and DemandOrderNumber = ''' + TheJobNumber + '''');

  end;

end.

 

Save and exit the Custom Script screen

 

You will see a new entry ‘Custom’ on the top toolbar of Ostendo.  If you click on this then your Script ‘Job Quote’ will be displayed.  If you click on this you will be taken through the script after which the Job Status will be updated to ‘Quote