3 Replies Latest reply: Jul 18, 2013 12:19 PM by jrimblas RSS

    Looping through row selector exonentially duplicating

    Hilton

      Using Apex 4.2

       

      Background

      Created a Tabular Form based on a view. Removed all the default multi-row updates and deletions, buttons and processes.

      I am using a tabular form because of the fact that I can gain access to a row selector.

      The row data itself is all read only so in effect this is a report with a row selector.

      This is because I can't find a way to select a row an interactive report, well I can and did but this was a work around.

       

      Problem

      I have created a button to process the selector to run the below code:

      begin
      kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'Selected Check Boxes:'||wwv_flow.g_f01(1)) ;
      kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'Selected Check Boxes:'||wwv_flow.g_f02(1)) ;
      
      
         for i in 1..wwv_flow.g_f01.count
         loop
         kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'i:'||i) ;
            kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'WF ID:'|| wwv_flow.g_f02 (wwv_flow.g_f01.count)) ;
         end loop;
      end;
      

      I just wanted to see what would be output. For one row this works fantastically and I can find the ID based on the row

      When I select more than one row the loop run's through for the number of rows but then also runs for the number of rows selected.

      So if I selected threee rows this above procedure would run three times, each times looping three times.

      I have set the execution scope to: For Created and Modified Rows in the button condition that appears.


      Required

      I only want to loop through the selected rows once per button click

      OR

      Know which row I am currently looping through.

       

      Really would appreciate some kind of input here.