Monday, October 26, 2015

Close Form A upon opening Form B, Oracle Forms When-Button-Pressed





When other form closing options failed use this suggestion

Follow the steps.

create a parameter

1) close_form



2) Initialize parameter before calling form B code in When-Button-Pressed trigger

PARAMETER.CLOSE_FORM = 'Y'

3) On When-New-Item-Instance trigger of the button that used to open other form, use below code.



        declare
          form_id FORMMODULE;
        BEGIN
            IF :PARAMETER.CLOSE_FORM = 'Y' THEN
            form_id := FIND_FORM(NAME_IN('SYSTEM.CURRENT_FORM'));
            IF NOT ID_NULL(form_id) THEN
              CLOSE_FORM(form_id);
            END IF;
            END IF;
            :PARAMETER.CLOSE_FORM := 'N';
        END;


Upon opening the form B in the foreground, form A still resides in the background.Form A closes when brought to foreground. When form B is closed form A also closes.

No comments:

Post a Comment