2 Replies Latest reply: Mar 11, 2013 3:37 PM by user346369 RSS

    Oracle forms when-validate-item trigger

      Forms [32 Bit] Version (Production)
      Oracle9i Enterprise Edition Release - 64bit Production
      With the Partitioning, OLAP and Oracle Data Mining options
      JServer Release - Production
      Oracle Toolkit Version (Production)
      PL/SQL Version (Production)
      Oracle Procedure Builder V10. - Production
      PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
      Oracle Query Builder - Production
      Oracle Virtual Graphics System Version (Production)
      Oracle Tools GUI Utilities Version (Production)
      Oracle Multimedia Version (Production)
      Oracle Tools Integration Version (Production)
      Oracle Tools Common Area Version
      Oracle CORE Production

      I have a field called equip_code and have some validations on the when-validate-item trigger that populates some messages ans then opens a comment box. Next to this equip code item I have a button for list of values. If the user clicks on the button (LOV) I have this code.

           if FORM_SUCCESS then
      end if;

      How do I force the when-validate-item trigger to fire once the user chooses from the list of values.

      On key-next-item I have this code

      if form_failure then
      raise form_trigger_failure;
      end if;

      I have this so that when-validate-item trigger fires before key-next. But when the user chooses from list of values, I want the when-validate-item trigger to fire. Any help appreciated.
        • 1. Re: Oracle forms when-validate-item trigger
          Andreas Weiden
          Put an additional VALIDATE(ITEM_SCOPE) in the button's code.
          • 2. Re: Oracle forms when-validate-item trigger
            On your LOV button, in the when-button-pressed trigger, just do this:

            If Form_Success then
            End if;

            I don't think you need anything on the key-next-item trigger. If the value of equip_code changes, the WVI trigger will run when focus (the cursor) leaves the field.

            If you want to force validation immediately after the user chooses a value from the LOV, then you can change the List_Values; call above to Do_key('LIST_VALUES'); and then create a Key-ListVal trigger on the item. In its code, you would code: If Show_LOV('MY_LOV') then Validate(Item_Scope);

            You should NOT put validation code in the key-next-item trigger, because it does not run if the user uses the mouse to click into a different field, or uses any number of other methods to leave the field.