2 Replies Latest reply: Jun 29, 2013 7:48 AM by 97625536-f548-45e8-803a-0e16c32f39d2 RSS

    How to know if commit_form is successful

    97625536-f548-45e8-803a-0e16c32f39d2

      Hi

      I am new with Oracle Forms.

       

      I am developing an application using Oracle 10g express and forms 6i.

      Can somebody please guide me regarding code under SAVE button(I have placed some push buttons on form for add_new, Save, Reset ect).

      I am trying to handle DUPLICATE_RECORDS AND NULL_VALUES through this code which is in ON_ERROR form trigger

       

       

      declare

      x number;    

       

      begin

         

      if dbms_error_code in (-1400, -1407) then

         

           x:=show_alert('alert_Empty');

         raise form_trigger_failure;

       

      elsIF dbms_error_code='-00001' then

          

           x:=show_alert('alert_duplicate');

         raise form_trigger_failure;

          

      end if;

       

      end;

      and code under SAVE button is

       

      declare

      a number;

      begin

       

                 commit_form;

                  a:=show_alert('alert_Saved');

                  clear_form(NO_VALIDATE);

                  raise form_trigger_failure;   

       

      but even form is prompting for duplicate value or null value, Alert_save is showing as record has been saved.

       

      My question is how I can be sure that record has been saved actually?????

       

      I have tried to check :SYSTEM.FORM_STATUS and it return CHANGED .

       

      is there any approach I should use, any sample piece of code will be much appreciated.

       

      regards.

             

       

       

       

       

       

       

      end;