Form focus triggers

Forms have two focus events with which you can use a focus trigger. The following table explains each focus event, and the corresponding value of the focus_type parameter required in the Trigger_RegisterFocus() function:

[spacer]

Focus event

Description

Value of focus_type

pre

Occurs each time the form opens, not each time the form restarts.

TRIGGER_FOCUS_PRE

post

Occurs each time the form closes.

TRIGGER_FOCUS_POST


Example 4: Form focus trigger

This trigger is activated when the Customer Maintenance form closes and the form’s post script runs (indicated by TRIGGER_FOCUS_POST).

{Name: Startup}
local integer l_result;

l_result = Trigger_RegisterFocus(anonymous(form RM_Customer_Maintenance), TRIGGER_FOCUS_POST, TRIGGER_AFTER_ORIGINAL, script IG_Close_Contact_History);
if l_result <> SY_NOERR then
	warning "Trigger registration failed.";
end if;

This trigger processing procedure for the form focus trigger simply closes the third-party form.

{Name: IG_Close_Contact_History} 

close form IG_Contact_History;


Documentation Feedback