Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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.

...

Code Block
<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:


Code Block
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.