0 Replies Latest reply on Oct 14, 2019 2:32 PM by Mohammed tanveer Hussain

    FORM PERSONALIZATION IN HR MODULE CALL CUSTOM PROCEDURE AND DISPLAY MESSAGE

    Mohammed tanveer Hussain

      HI,

       

       

      I am doing form personalization in HR module .my requirement is when the end-user is  trying to terminate than a procedure should get executed and check the condition if the is not met then it should display an error in the front end form

       

      CREATE OR REPLACE PROCEDURE validate_terminate

      IS

         u_id    NUMBER := fnd_global.user_id;

         e_id    NUMBER;

         p_id    NUMBER;

         l_yes   VARCHAR2 (1);

         null_found EXCEPTION;

      BEGIN

         SELECT   EMPLOYEE_ID

           INTO   e_id

           FROM   fnd_user

          WHERE   user_id = u_id;

       

       

         SELECT   person_id

           INTO   p_id

           FROM   per_all_people_f

          WHERE   person_id = e_id;

       

       

         SELECT   'Y'

           INTO   l_yes

           FROM   DUAL

          WHERE   EXISTS

                     (SELECT   'Y'

                        FROM   pa_expenditure_items_all paei,

                               pa_expenditures_all pae

                       WHERE       paei.expenditure_id = pae.expenditure_id

                               AND pae.incurred_by_person_id = p_id

                               AND paei.cost_distributed_flag = 'N');

       

       

         IF l_yes = NULL

         THEN

            DBMS_OUTPUT.put_line ('USER CANNOT PERFORM TERMINATE');

            RAISE null_found;

         END IF;

      EXCEPTION

         WHEN null_found

         THEN

            DBMS_OUTPUT.put_line ('CONDITION IS NOT MET');

            DBMS_OUTPUT.put_line ('CANNOT PROCESS TERMINATE');

         WHEN NO_DATA_FOUND

         THEN

            DBMS_OUTPUT.put_line ('CONDITION IS NOT MET');

            DBMS_OUTPUT.put_line ('CANNOT PROCESS TERMINATE');

      END;

      /

       

       

      The procedure is working fine but I am unable to execute it in the front end

       

       

      as I am doing these below are the screenshots

       

      t.png

       

      s.png

      but the procedure is not getting executed.

       

      thanks and regards

       

       

      Tanveer