The Trigger_RegisterProcedureByName() function registers a procedure trigger for a procedure in the specified dictionary. A procedure trigger is activated when the specified procedure is run.
Trigger_RegisterProcedureByName(product_ID, procedure_name, attach_type, script processing_procedure {, tag})
• product_ID – An integer specifying the ID of the product that contains the procedure for which the trigger is being registered.
• procedure_name – A string containing the name of the procedure for which the procedure trigger is registered. When this procedure is run, the procedure trigger is activated. If the procedure is a form procedure, be sure to include the of form form_name clause in the name.
• attach_type – An integer indicating when the procedure trigger is activated, relative to the original procedure:
Constant |
Value |
---|---|
TRIGGER_BEFORE_ORIGINAL |
1 |
TRIGGER_AFTER_ORIGINAL |
2 |
• script processing_procedure – A procedure you write that runs in response to the procedure 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. |
SY_INVALID_OBJECT |
4 |
The object for which the trigger is being registered cannot be found. |