F0cus
F0cus

Reputation: 625

Oracle Forms- 'FND_MESSAGE' issue

I have created one POPUP in Oracle Forms (Custom PLL - Oracle EBS R12)

fnd_message.set_name ('XX', 'CASCADE_SHIPPING_METHOD');
         --    fnd_message.show;
         n_button_selection :=
            fnd_message.question ('Yes',
                                  'No',
                                  '',
                                  1,
                                  2,
                                  3);
 
 
IF n_button_selection = 1
         THEN
             Procedure1();
         ELSIF n_button_selection = 2
         THEN
             Procedure2();
         ELSE
            NULL;
         END IF;

This code is working fine But, If the User CLOSE the form(by clicking the 'X' mark), then ELSIF condition is executed and calling the procedure2. I expect the control goes to ELSE and do nothing. Kindly help.

I modified the code as

 fnd_message.set_name ('XX', 'CASCADE_SHIPPING_METHOD');
      
         n_button_selection :=
            fnd_message.question ('Yes',
                                  'No',
                                  'Cancel',
                                  1,
                                  2,
                                  3);

         --If user select "Yes" option to cascade, then enter inside if and call the proc to cascade

         IF n_button_selection = 1
         THEN
          MESSAGE('Pressed Yes-For Lines Cascading');
          shipping_method (l_header_id,
                            ship_method,
                           'Lines');
         ELSIF n_button_selection = 2
         THEN
         MESSAGE('Pressed No-For Header Cascading');
            shipping_method (l_header_id,
                              ship_method,
                               'Header');
         ELSE
         	MESSAGE('Inside ELSE Condition');
            NULL;
         END IF;

but still If I close the form the control Goes to Button Selection 2 that is ELSIF.

Upvotes: 1

Views: 4631

Answers (1)

Vinish Kapoor
Vinish Kapoor

Reputation: 679

Try this:

fnd_message.set_name ('XX', 'CASCADE_SHIPPING_METHOD');
         --    fnd_message.show;
         n_button_selection :=
            fnd_message.question ('Yes',
                                  'No',
                                  'Cancle',
                                  1,
                                  3);


IF n_button_selection = 1
         THEN
             Procedure1();
         ELSIF n_button_selection = 2
         THEN
             Procedure2();
         ELSE
            NULL;
         END IF;

Upvotes: 0

Related Questions