1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

catching FORM_TRIGGER_FAILURE on any form

Discussion in 'Oracle Forms and Reports' started by member.forums@gmail.com, Jun 30, 2009.

  1. member.forums@gmail.com

    member.forums@gmail.com Active Member

    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    80
    Hi
    Is there any way to perform an action when form_trigger_failure is raised on any form in the gui.

    Like creating trigger which would fire everytime a FOR_TRIGGER_FAILURE excetion is raised in any of the forms

    Any help would be appreciated
    Sapan
     
  2. tyro

    tyro Forum Genius

    Messages:
    368
    Likes Received:
    20
    Trophy Points:
    260
    Location:
    India
    Well if you want to raise the FORM_TRIGGER_FAILURE in such a way that it stops the whole commit and fails the Key-COMMIT trigger then you can use a global variable, initialize it before you do the commit, set it in the Pre-COMMIT trigger, and check it in the Key-COMMIT trigger after the COMMIT statement. Create the following trigger code:

    In the Key-COMMIT trigger:
    Code (Text):

       :global.check:='false';
       COMMIT;
       IF :global.check='true' THEN
          RAISE FORM_TRIGGER_FAILURE;
       END IF;
       MESSAGE('Key commit all done!');
     
    In the Pre-COMMIT trigger:
    Code (Text):

       IF 1=1 THEN
          :global.check:='true';
          RAISE FORM_TRIGGER_FAILURE;
       END IF;
       MESSAGE('Pre commit all done!');
     
    Basically, remember to propagate the trigger failure with globals if that is how you want the forms to function!!!

    Secondly in place of the globals, you may also use FORM_SUCCESS and FORM_FAILURE functions to check for failure.
     
    gurujothi likes this.