PdcApplication.RunScript: Difference between revisions
Created page with "== Declaration == == Description == == Notes == == Code example == <source lang="vb"> </source> == Availability ==" |
No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Declaration == | == Declaration == | ||
RunScript(ScriptName as String,ParamList as String) as String | |||
== Description == | == Description == | ||
Run a second script from current script | |||
== Notes == | == 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.<br /> | |||
'''Note:''' The script that is started this way should NOT contain a Form Create procedure!!<br /> | |||
'''Note:''' The scriptname is case sensitive!! | |||
'''Parameters Description'''<br /> | |||
ScriptName Name of the script to start<br /> | |||
ParamList A parameter string | |||
== Code example == | == 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. | |||
<source lang="vb"> | |||
dim strParameters | |||
dim strDNID | |||
strDNID = pdc.ActiveObjectID | |||
pdc.ParamStr = strDNID pdc.RunScript "SelectTransport", strDNID | |||
msgbox "For this delivery " & pdc.ParamStr & " is the cheapest option." | |||
</source> | </source> | ||
== Availability == | == Availability == | ||
Available since November 2006 (From version 3.7). |
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).