3 Replies Latest reply on Aug 10, 2019 6:17 AM by iTech Solutions

    How check duplicate record at block level in Oracle forms

    969482

      Hi All,

       

      My Scenario is like i have a block which shows customerid, orderid, active/inactive checkbox.

      one customer can have multiple orders(severals rows).

      objective is to select multiple customer (using the checkbox) and make them inactive.

      BUT user cant make inactive all the orders for a customer, atleast one should remain.

       

      customerid      orderid      active/inactive(checkbox)

      c1                     order1      A

      c2                     order1      A   

      c1                     order1      A

      c1                     order1      A

      c2                     order1      A

      c3                     order1      A

       

      here we have 3 c1 (among this user should be able to inactivate ONLY any 2) . same goes for c2 (among 2 data for c2, one can be made inactive).

       

      How to achieve this ? kindly help

       

      I am using below logic

       

      GO_BLOCK('blcok');

            first_record;

            LOOP

              IF :block.active/inactive = 'A'  THEN

                :Block.Databaseitem      := 'I';

              END IF;

              EXIT WHEN :SYSTEM.last_record = 'TRUE';

              next_record;

            END LOOP;

       

      Regards,

      Balaji