How to Run a Script with an Action
Open the Action Library
1: Click Admin from the menu.
2: Click Action Library from the drop down list - the Action Library will open.
Select the Action to Edit
1: Select the action to edit.
2: Click Edit from the menu - the Edit Action window will open.
Open the Script Window
NOTE: Scripts should only be written by people that are trained to write scripts as they can damage your database.
1: Select the Script tab - the Script window will open.
2: Tick the Script Enabled checkbox to add a new script - Leaving this unckecked will deactivate the script so that it will not run.
3: Type or Edit the script - This can only be done if the Script is Activated.
4: Click OK to save the changes and close the window.
For Advanced Users Only
FURTHER NOTES
The IronPython we are using is based on Python 2.6 - this reference is a bit heavy, but quite complete: http://rgruet.free.fr/PQR26/PQR2.6.html
Also, "official docs" are: http://www.ironpython.net/documentation/
And a wiki from the IronPython in Action book http://www.ironpython.info/index.php/Main_Page
You can run scripts such as the following one – please be aware that the scripting module is very unforgiving of incorrect spacing (at the moment):
import clr
import sys
# Import the file
import ClaimsLibrary
class ClientScript:
def RunQuery(self, dataSet, connection, otherParam):
cycLib = ClaimsPythonLib(dataSet, connection)
queryResult1 = None
queryResult2 = None
retVal = None
#
# Add your code below
#
# For example
queryResult1 = cycLib.isTrue("Claim","ClientContactFirstName = 'Jacob' And ClientContactLastName = 'Smith'" )
queryResult2 = cycLib.isTrue("Claim","ClientContactFirstName = 'Jacob' " )
if queryResult1 == True & queryResult2 == False:
retVal = 1091
else:
retVal = 1085
#
#
# Do not put anything else beyond here
#
return retVal
0 Comments
Add your comment