Using CALL_FORM with OPEN_FORM in the Same Application
When you execute CALL_FORM to invoke a modal form, the calling form is disabled until the end user exits the called form (and returns to the calling form). When a calling form is disabled, its windows are greyed out, and end users are unable to set focus to items in the form.
A called form can in turn call another form. The result is three forms loaded in memory one of which is active and available to the end user. When successive forms are loaded with the CALL_FORM procedure, the resulting module hierarchy is known as the call form stack.
Using CALL_FORM with OPEN_FORM in the same application Restrictions
When you invoke multiple forms in the same application with the Built-in procedures OPEN_FORM and CALL_FORM, be aware of the following restrictions:
- Navigation You cannot navigate programmatically
to a disabled form in a call form stack.
- Calling Forms An open form cannot execute the
CALL_FORM procedure if a chain of called forms has been initiated by another
open form.
Using CALL_FORM with OPEN_FORM in the same application Examples
- Consider the following example: (1) form A calls
form B, (2) form B opens form C, (3)
form C opens form D, and (4) form B calls Form E. At this
point, three forms are active and navigable (C, D and E), and two are disabled
and non-navigable (A and B). Any attempt to navigate programmatically to forms
A or B will raise an error.
Together, forms A, B and E represent the current call form stack in the application.
If form C attempts to call a form, an error will occur since an open form
cannot execute CALL_FORM when there is an existing stack of called forms initiated
by another form (form A in this case). Before form C can successfully execute
CALL_FORM, the end user or the application must exit form E (to return to
form B), then exit form B (to close out the call form stack).
If form D exits, focus returns to the form from which D was opened (form C
in this case). If C then exits, focus returns to form E, even though form
B originally opened form C. This occurs because B currently is disabled because
it issued a CALL_FORM to invoke form E.