Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to fire RAISE FORM_TRIGGER_FAILURE

buggleboy007Nov 25 2019 — edited Nov 27 2019

I have the following code in PL/SQL library under a procedure called MOD$WHEN_VALIDATE_ITEM trigger:

IF GET_SYS_PARAM(NAME_IN('SCTN.BUSINESS_UNIT_ID'), 'CLASS_ID_VARCHAR2_IND') IN('N','Y',NULL)THEN

      IF NAME_IN('SCTN.CLASS_ID') = '0000' THEN

       MESSAGE('SANDEEP 4 ZEROS'); PAUSE;

       rams$msg_alert('2593', 'E', TRUE);

       RAISE FORM_TRIGGER_FAILURE; 

      ELSIF NAME_IN('SCTN.CLASS_ID') = '000' THEN

       MESSAGE('SANDEEP 3 ZEROS'); PAUSE;

        rams$msg_alert('2593', 'E', TRUE);

        raise form_trigger_failure;

      ELSIF NAME_IN('SCTN.CLASS_ID') = '00' THEN

       MESSAGE('SANDEEP 2 ZEROS'); PAUSE;

       rams$msg_alert('2593', 'E', TRUE);

       raise form_trigger_failure; 

      ELSIF NAME_IN('SCTN.CLASS_ID') = '0' THEN

       MESSAGE('SANDEEP single ZERO'); PAUSE;

       rams$msg_alert('2593', 'E', TRUE);

       raise form_trigger_failure;

      END IF;

END IF;

 

This code fires when I enter a class id (in the form) as '0000' or '000' or '00' or '0'. Basically we need to prevent the user from entering all 0's and then ensure that the user is not able to navigate the class id text box.

Everything works fine excepting RAISE FORM_TRIGGER_FAILURE i.e. the alert is fired and then the cursor automatically navigates to the next text item. I have tried a lot of options including GO_ITEM, but realised that this does not work in PL/SQL libraries as it is outside of the form. I am also new to Oracle forms.

My question is: is there any way to ensure that the cursor stays back in class id text box so that the user corrects this and only then navigates.

This post has been answered by Holger.Lehmann on Nov 26 2019
Jump to Answer
Comments
Post Details
Added on Nov 25 2019
4 comments
1,738 views