2 Replies Latest reply on Sep 17, 2018 10:15 AM by fac586

    How to display error message in inline dialogs

    Soukaina IDRISSI

      Hi everyone,

      I created one Static Content Region, in Inline Dialogs Position, containing three Items and one button Apply.

      So, when i click on Apply button i'm using DA  Execute PL/SQL Code, that display error when one of table field is null like that:

      DECLARE
          v_nseq             VARCHAR2 (500);
          v_cpt_prlv_exist   NUMBER;
      BEGIN
          SELECT   COUNT (1)
            INTO   v_cpt_prlv_exist
            FROM   infos
           WHERE   id_client = :p75_id_client AND cpte_prl IS NOT NULL;
      
      
          IF (v_cpt_prlv_exist = 0 AND :p75_cpte_prl IS NULL)
          THEN
          apex_application.g_print_success_message := '<span style="color:red"> Il doit y avoir au moins un compte de prélévement pour le client !.</span>';
             /* apex_error.add_error (
                  p_message            => 'Il doit y avoir au moins un compte de prélévement pour le client !',
                  p_display_location   => apex_error.c_inline_with_field_and_notif,
                  p_page_item_name     => 'P75_CPTE_PRL');*/
          --p_display_location   => apex_error.c_inline_in_notification);
          ELSE
              SELECT   seq.NEXTVAL INTO v_nseq FROM DUAL;
      
              INSERT INTO infos (cpt_id,
                                          cpt_qual,
                                          cpt_code,
                                          cpt_date_ouverture,
                                          cpt_id_client,
                                          cpte_prl)
                VALUES   (v_nseq,
                          :p75_qualite,
                          :p75_code,
                          :p75_date_ouverture,
                          :p75_id_client,
                          :p75_cpte_prl);
          END IF;
      END;
      

       

      My issue:

      When i click on Apply button, and Item P75_cpte_prl  is not checked, i didnt get error message

       

      NB: Version of apex production 5.1.0

       

      Thank you for help.

        • 2. Re: How to display error message in inline dialogs
          fac586

          Soukaina IDRISSI wrote:

           

          I created one Static Content Region, in Inline Dialogs Position, containing three Items and one button Apply.

          So, when i click on Apply button i'm using DA Execute PL/SQL Code, that display error when one of table field is null like that:

          1. DECLARE
          2. v_nseqVARCHAR2(500);
          3. v_cpt_prlv_existNUMBER;
          4. BEGIN
          5. SELECTCOUNT(1)
          6. INTOv_cpt_prlv_exist
          7. FROMinfos
          8. WHEREid_client=:p75_id_clientANDcpte_prlISNOTNULL;
          9. IF(v_cpt_prlv_exist=0AND:p75_cpte_prlISNULL)
          10. THEN
          11. apex_application.g_print_success_message:='<spanstyle="color:red">Ildoityavoiraumoinsuncomptedeprélévementpourleclient!.</span>';
          12. /*apex_error.add_error(
          13. p_message=>'Ildoityavoiraumoinsuncomptedeprélévementpourleclient!',
          14. p_display_location=>apex_error.c_inline_with_field_and_notif,
          15. p_page_item_name=>'P75_CPTE_PRL');*/
          16. --p_display_location=>apex_error.c_inline_in_notification);
          17. ELSE
          18. SELECTseq.NEXTVALINTOv_nseqFROMDUAL;
          19. INSERTINTOinfos(cpt_id,
          20. cpt_qual,
          21. cpt_code,
          22. cpt_date_ouverture,
          23. cpt_id_client,
          24. cpte_prl)
          25. VALUES(v_nseq,
          26. :p75_qualite,
          27. :p75_code,
          28. :p75_date_ouverture,
          29. :p75_id_client,
          30. :p75_cpte_prl);
          31. ENDIF;
          32. END;

          My issue:

          When i click on Apply button, and Item P75_cpte_prl is not checked, i didnt get error message

          What problem are you actually trying to solve? What is the purpose of the inline dialog region?

           

          When used in a PL/SQL dynamic action, neither apex_error.add_error nor apex_application.g_print_success_message will communicate any error information back to the calling page. Also note that apex_application.g_print_success_message is an undocumented variable and therefore should not be used by developers.