PdcApplication.RunScript

From External Bemet Wiki
Revision as of 11:13, 21 May 2012 by Mike (talk | contribs)
Jump to navigation Jump to search

Declaration

RunScript(ScriptName as String,ParamList as String) as String

Description

Run a second script from current script

Notes

This method runs a script and returns the global pdc.ParamStr value. Specifically useful when the same logic is required in multiple user exits.

Parameters Description
ScriptName Name of the script to start
ParamList A parameter string

Code example

This code example starts as a userexit when closing a delivery note. The activeobjectID is therefore the Delivery Note ID. A separate script runs using this delivery note ID as a parameter. Once the separate script (SelectTransport) has finished and populated the global parameter string with the cheapest transport option, this can now be used again in the original script.

dim strParameters
dim strDNID

  strDNID = pdc.ActiveObjectID

  pdc.ParamStr = strDNID  pdc.RunScript "SelectTransport", strDNID

  msgbox "For this delivery " & pdc.ParamStr & " is the cheapest option."

Availability

Available since November 2006 (From version 3.7).