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.

    DirectionNameDescription
    InputconnectionFileNameThe 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.
    OutputDatabaseConnection 
  • CreateManagedDatabaseConnection(): Creates a managed database connection that allows access to the database used by the host application.

    DirectionNameDescription
    OutputManagedDatabaseConnection 
  • 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, ...}).

    DirectionNameDescription
    InputcommandNameThe name of the command to execute
    InputargsAny 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