Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Loop through a block

CashyOct 8 2014 — edited Oct 9 2014

Hi All,

Hope somebody can help.

I have a form in Oracle E Business Suite that I am trying to modify.  I have a detail block and I am trying to pass the value of the primary key of the row into a cursor which returns a value.

If that value is 0, I am trying to display a message box.

I don't use forms much so my logic may be a bit flawed.

I am trying to loop through the rows in the block 'DLVB' and pass the "cell" (field name is called 'DETAIL_LABEL' ) into the cursor called price_c.  If any of the rows return a price of 0, then I want a message box to appear.

Hope that make sense.

Chris

DECLARE 

CURSOR price_c (x_line IN NUMBER) IS

  SELECT ola.unit_selling_price

  FROM wsh_delivery_details wdd

  ,    oe_order_lines_all ola

  WHERE wdd.source_code = 'OE'

  AND wdd.source_line_id = ola.line_id

  AND wdd.delivery_detail_id = x_line;

  

BEGIN

   IF (form_name = 'WSHFSTRX' and block_name = 'DLVB')

     THEN GO_BLOCK('DLVB');

      FIRST_RECORD;

       LOOP

        --MESSAGE(:DLVB.DETAIL_LABEL);

         FOR price_r IN price_c (:DLVB.DETAIL_LABEL)

          LOOP

           IF price_c.unit_selling_price = 0

            THEN x_price := 0;

           END IF;

          END LOOP;

       

        EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';

       NEXT_RECORD;           

       END LOOP; 

  

   END IF;

  

   IF x_price = 0

    THEN

     message ('This order has items with an item price of '||x_price||'.');

     message ('This order has items with an item price of 0');

   END IF;

    

END;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2014
Added on Oct 8 2014
6 comments
1,903 views