Global Methods
Global methods are available from anywhere in an addon script. They represent functionality that is not tied to any specific user interface element. Detailed information on each of the globally accessible functions, including their parameters, purpose, and return values, is below.
CreateDatabaseConnection(string connectionFileName):Â Creates an external database connection that can be used to query a data source.
Direction Name Description Input connectionFileName The name of the connection file to use when creating the connection. This can contain a path, either rooted or relative to the addon's folder. Output DatabaseConnection  CreateManagedDatabaseConnection(): Creates a managed database connection that allows access to the database used by the host application.
Direction Name Description Output ManagedDatabaseConnection  ExecuteCommand(string commandName, object args): Executes a form command supported by the current form using the provided args. args can be either a single value or a Lua table of values (ie: {"Detail", 0, ...}).
Direction Name Description Input commandName The name of the command to execute Input args Any data needed by the command being executed GetClientImage(string name):Â Retrieves an Image object corresponding to the name provided from the application resources file.
Parameter Direction
Parameter Name
Parameter Description
Input
name
The name of the image to retrieve.
Input
Image
Â
GetFieldValue(string fieldSource, string fieldName):Â Retrieves the value of a field (fieldName) on a data source (fieldSource) exposed by the current form.
Parameter Direction
Parameter Name
Parameter Description
Input
fieldSource
The name of the data source containing the field
Input
fieldName
The name of the field to retrieve
Output
object
Â
GetInterfaceManager():Â Retrieves the ScriptInterfaceManager associated with the current script.
Parameter Direction
Parameter Name
Parameter Description
Output
ScriptInterfaceManager
Â
GetLocalImage(string path) - returns an Image:Â Retrieves an Image object based on the file provided by the path argument. The path can be either rooted or relative to the script file's location.
Parameter Direction
Parameter Name
Parameter Description
Input
path
The path to the image file to load
Output
Image
Â
GetSetting(string settingName):Â Retrieves the value of the specified setting from the addon settings. The setting value will automatically be converted to the correct type based on the type specified in the setting's definition.
Parameter Direction
Parameter Name
Parameter Description
Input
settingName
The name of the setting to be retrieved
Output
string, bool, or double
Â
LogDebug(string message): Writes the message to the debug log. Debug logging needs to be enabled for the client (in ILLiadClient.log.config) before these messages will output to the log file.
Parameter Direction
Parameter Name
Parameter Description
Input
message
The message to be logged
Print(DataTable table, string dataSource, string templateDocuments):Â Prints data from an addon provided table using the provided data source and template documents.
Parameter Direction
Parameter Name
Parameter Description
Input
table
The table of information that should be printed
Input
dataSource
The name of the xls file the data should be added to when printing
Input
templateDocuments
The documents that should be merged with the xls file when printing
SetFieldValue(string fieldSource, string fieldName, object value):Â Sets the value of a field (fieldName) on a data source (fieldSource) exposed by the current form to the given value.
Parameter Direction
Parameter Name
Parameter Description
Input
fieldSource
The name of the data source containing the field
Input
fieldName
The name of the field to set
Input
value
The new value of the field