Re: Forms 3.0 trigger Q

From: Michael P. Stein <mstein_at_access3.digex.net>
Date: 6 Jan 1994 19:02:33 -0500
Message-ID: <2gi8qp$jqj_at_access3.digex.net>


>On this subject, anyone found a nice way for the dialogue box 'Do you
>wish to commit the changes - Yes, No, cancel' to run your KEY-COMMIT
>trigger if the user says Yes rather than just doing a commit.

    There is a way - whether it's nice or not is a matter of opinion. I presented it at ECO a couple of years ago, and at Mid-Atlantic Oracle Users' Group; the paper (SQL*Forms Wizardry) is I believe still available on CompuServe in the Oracle Forum. I am on travel until the 24th and cannot send anyone the full paper until then, but here's the gist of it:

  1. Each and every function key has an explicit KEY-xxx trigger. The first line is
                  :GLOBAL.LAST_KEY_PRESSED := '<keyname>';

   2.  The real code goes in separate procedures or triggers, say,
       KDELREC for the "guts" of KEY-DELREC.  Put the KEY-COMMIT code
       prior to COMMIT in KCOMMIT1, and the code after COMMIT in KCOMMIT2.

   3. PRE-COMMIT starts with:

            if :GLOBAL.LAST_KEY_PRESSED <> 'COMMIT' then ...

       If KCOMMIT1 and 2 do not contain restricted procedures, 
       PRE-COMMIT can execute #1 directly, and POST-COMMIT #2.
       Otherwise, PRE-COMMIT must raise an exception (you could
       define a special NEED_COMMIT exception) and the exception
       handler for NEED_COMMIT in each trigger/procedure which could
       possibly cause the Commit window to appear would then set
       GLOBAL.LAST_KEY_PRESSED to COMMIT and fire off the entire
       commit sequence before retrying the operation which was
       originally requested.


-- 
Mike Stein			The above represents the Absolute Truth.
POB 10420			Therefore it cannot possibly be the official
Arlington, VA  22210		position of my employer.
Received on Fri Jan 07 1994 - 01:02:33 CET

Original text of this message