The Trigger_RegisterFunction() function registers a function trigger for use with the runtime engine. A function trigger is activated when a specified function is run.
Trigger_RegisterFunction(function function_name {of form form_name}, attach_type, [function processing_function | script processing_procedure] {, tag})
• function function_name – A function in the application for which the function trigger is registered. When this function is run, the function trigger is activated.
• of form form_name – An optional parameter specifying a form name. Use this only if function_name is a form function.
• attach_type – An integer indicating when the function trigger is activated, relative to the original function:
Constant |
Value |
---|---|
TRIGGER_BEFORE_ORIGINAL |
1 |
TRIGGER_AFTER_ORIGINAL |
2 |
• function processing_function | script processing_procedure – A function or procedure you write that runs in response to the function trigger.
• tag – An optional returned integer that uniquely identifies the trigger. This value is used when you want to unregister, enable or disable the trigger individually.
An integer corresponding to the following constants:
Constant |
Value |
Description |
---|---|---|
SY_NOERR |
0 |
No error occurred. |
SY_UNKNOWN |
1 |
An unknown error occurred and the trigger was not registered. |
SY_INVALID_SCRIPT |
2 |
The trigger processing script was either not found or had the wrong number of parameters. The trigger was not registered. |
If a function runs in response to the function trigger, it must have exactly the same set of parameters as the function that is being triggered on. If a procedure runs in response to the function, it can’t have any parameters.