Using Addons on Client Forms

Form addons will appear as a tab on the host form. ILLiad supports addons on the request form, user form, and the main form. Information regarding data that is exposed on each of those forms and which commands those forms allow can all be found below. The following forms are supported:

  • Main Form (FormMain)
  • Request Form (FormRequest)
  • User Form (FormUser)
  • Modules (e.g., Borrowing Processing)

To configure an addon to be used on a form, the addon's configuration file must specify which form(s) the addon should load on. Multiple form elements can be added to duplicate addon functionality on additional forms.

Main Form (FormMain)

Supported Commands

Exposed Data

  • None

Request Form (FormRequest)

Supported Commands

Exposed Data

The following data sources are available on the request form. Access to the data is provided via the GetFieldValue and SetFieldValue functions. See Global Methods for more information.

  • Transaction
  • User (_read-only_)
  • Lender (_read-only_)

User Form (FormUser)

Supported Commands

Exposed Data

The following data sources are available on the request form. Access to the data is provided via the GetFieldValue and SetFieldValue functions. See Global Methods for more information.

  • User

Example

The following is an example of a configuration file for a sample addon that will load on the ILLiad request form.

<Configuration>
	<Name>Sample Request Form Addon</Name>
	<Author>Atlas Systems, Inc.</Author>
	<Version>1.0</Version>
	<Active>False</Active>
 
	<Description>...</Description>
 
	<Forms>
		<Form>FormRequest</Form>
	</Forms>
 
	<Settings></Settings>
 
	<Files>
		<File>SampleRequestAddon.lua</File>
	</Files>
</Configuration>

Module Processes

Addons can be written to run for certain process types (e.g. only for Borrowing requests, or only for Lending & Doc Del requests) and run within the associated forms. This allows the addon to specify the module being used. It is recommended to configure this setting if an addon is only relevant to one or two process types, as loading irrelevant browser tabs can slow down the client for no reason. The easiest way to prevent irrelevant browser tabs from running is to use an if statement in the addon's init function. As long as the if the statement is the first statement in the init function, no browsers or other form controls will be created, and no other functions in this addon will execute.
For example, the following code will cause the addon to immediately halt if the request is not a Borrowing request:
function init()
if not GetFieldValue("Transaction","ProcessType")=="Borrowing" then
return
end
--
-- put your other init code here
--
end
The above code can also be modified to run for any transaction that isn't a Borrowing request. To do this remove the "not" from the if statement.