PdcApplication.RunScript: Difference between revisions
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
This method runs a script and returns the global pdc.ParamStr value. | This method runs a script and returns the global pdc.ParamStr value. | ||
Specifically useful when the same logic is required in multiple user exits.<br /> | Specifically useful when the same logic is required in multiple user exits.<br /> | ||
'''Note:''' The script that is started this way should NOT contain a Form Create procedure!! | '''Note:''' The script that is started this way should NOT contain a Form Create procedure!!<br /> | ||
'''Note:''' The scriptname is case sensitive!! | '''Note:''' The scriptname is case sensitive!! | ||
Latest revision as of 06:14, 3 September 2015
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.
Note: The script that is started this way should NOT contain a Form Create procedure!!
Note: The scriptname is case sensitive!!
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).