7 Replies Latest reply: Jan 25, 2014 11:21 PM by Shoaib RSS

    Textfield Trigger

    jhe-jhe

      dear all

           i have problem with trigger, i have script like below

       

      DECLARE

          VCOUNT NUMBER;    

      BEGIN

          SELECT COUNT(*) INTO VCOUNT FROM EPM_JJ_EXPEDISI WHERE ORG_ID  =  :GLOBAL.ORG_ID AND  NO_INVOICE_EXPEDISI = :EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI;                

        IF nvl(VCOUNT,0) <> 0 THEN

                  FND_MESSAGE.DEBUG('NOMOR INVOICE SUDAH TERPAKAI !!');

                  :EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI := '' ;

                  raise form_trigger_failure;

                  GO_ITEM('EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI');

        END IF;

      EXCEPTION WHEN OTHERS THEN NULL;

      END;

       

       

      when i run this form, why the cursor can't go back to 'invoice_expedisi', and always go to the next field 'jml'.

       

      thanx for u'r help

        • 1. Re: Textfield Trigger
          John Stegeman

          Ask on the proper forum (the one for Forms)

          • 2. Re: Textfield Trigger
            David Berger

            Hello jhe-jhe

             

            The Exception-Handling is not really good... You ignore any kind of errors..

             

            Firstly I would start the correction here:

            EXCEPTION WHEN OTHERS THEN NULL;

            Regards, David

            • 3. Re: Textfield Trigger
              BluShadow

              Moderator Note: Your question has now been moved to the Forms forum as it is more suited than the SQL and PL/SQL forum

              • 4. Re: Textfield Trigger
                AnnPricks E

                Changed your code try the below and let me know in case of any issues

                 

                DECLARE

                    VCOUNT NUMBER;    

                BEGIN

                    SELECT COUNT(*) INTO VCOUNT FROM EPM_JJ_EXPEDISI WHERE ORG_ID  =  :GLOBAL.ORG_ID AND  NO_INVOICE_EXPEDISI = :EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI;                

                  IF VCOUNT <> 0 THEN

                            FND_MESSAGE.DEBUG('NOMOR INVOICE SUDAH TERPAKAI !!');

                            :EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI := '' ;

                            GO_ITEM('EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI');

                        raise form_trigger_failure;

                  END IF;

                EXCEPTION

                WHEN OTHERS THEN

                RAISE;

                END;

                • 5. Re: Textfield Trigger
                  Andreas Weiden

                  WEll, the most important info is missing.. In what trigger do you have that code?

                  • 6. Re: Textfield Trigger
                    Adeel Aslam

                    I Think U r Doing Wrong

                     

                    DECLARE

                        VCOUNT NUMBER;    

                    BEGIN

                        SELECT COUNT(*) INTO VCOUNT FROM EPM_JJ_EXPEDISI WHERE ORG_ID  =  :GLOBAL.ORG_ID AND  NO_INVOICE_EXPEDISI = :EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI;                

                      IF nvl(VCOUNT,0) <> 0 THEN

                                FND_MESSAGE.DEBUG('NOMOR INVOICE SUDAH TERPAKAI !!');

                                :EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI := '' ;

                                GO_ITEM('EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI');

                    raise form_trigger_failure;

                          END IF;

                    EXCEPTION WHEN OTHERS THEN NULL;

                    END;

                     

                    U r Raising Form Before It Go to this line GO_ITEM('EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI');

                    So U Have To Go Ist Then Raise.hope U Understand

                    • 7. Re: Textfield Trigger
                      Shoaib

                      Hi jhe-jhe,

                       

                      Check if there is any other trigger on "EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI".

                      There can be a trigger on "EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI" such as when new-item-instance or any other trigger which is executing next_teim.

                      So from that you are navigating to next_item.

                       

                      If this is "EPM_JJ_EXPEDISI.NO_INVOICE_EXPEDISI" is display item ,then also it will not navigate.

                       

                       

                      Shoaib