action
You can use this tag multiple times to pull back more than one data table from SQL.
Hierarchy
- script
- action
Syntax
<action timeout = string
returns = string
displaywarning = bool
allowhtmltagsinoutput = bool
name = string>
<!-- children -->
</action>
Attributes
Name | Description | Data Type | Required |
---|---|---|---|
timeout | defines how long the script can run.
|
string | no |
returns | defines how query results are returned.
|
string | yes |
displaywarning | If set to "true", allows a pop-up warning message to appear when running the script. By default, this is set to "true" if not included. | boolean | no |
allowhtmltagsinoutput | if set to "true", allows HTML tags to be interpreted by the browser instead of rendered as markup. | boolean | no |
name | the name used to reference the scripts in the item list drop-down menu as well as to populate the subreport header when displayed as a report. | string | no |
Reference inputs
The body of an action is a SQL script that allows you to pass in inputs. Inputs are referenced in the body of the action by wrapping their ID values in # symbols.
Example
When the following script runs, it replaces #dateReviewedField# with the actual column name of the field picked in the "Date Reviewed Field" drop-down menu. In addition, #dateReviewed# is replaced with the contents of the "Date Reviewed" field in the run page. Relativity inserts a CDATA tag. A CDATA tag is a token in XML that indicates anything following it up to the ]]> token is to be interpreted as unformatted text. This is important because, in SQL, the inequality operator is <>, which is an empty entity in an XML document. If you use <>, the resulting script would be invalid. This also means that you don't have to escape characters in that text block such as &.
<script>
<name>Update Script</name>
<input>
<constant id="dateReviewed" name="Date Reviewed" type="date"/>
<field id="dateReviewedField" name="Date Reviewed Field">
<filters>
<category>0</category>
<type>2</type>
</filters>
</field>
</input>
<action returns="status" name="Update Script" >
<![CDATA[
UPDATE
[Document]
SET
[#dateReviewedField#] = '#dateReviewed#'
]]>
</action>
</script>