Javier Isaaí
Javier Isaaí

Reputation: 450

How can I process checkbox items from an Oracle APEX report?

I am not an experienced APEX developer, hence this problem: I have a report with a few columns, the first one displays a checkbox whose value is the column ID for the row record, and I need to run a pl/sql function for each row checked but I have had no luck...

The relevant columns' SQL looks something like this (trimmed for the sake of simplicity):

SELECT
  apex_item.checkbox(1, p.ticket_id,'UNCHECKED') "Add",
  p.ticket_id,
  UPPER(SUBSTR(p.status_code, 1, 3)) status,
  p.last_update
FROM problems p
... etc.

The first column is set to render as a "Simple Checkbox" and its got #TICKET_ID# for its List Of Value parameters. I have a submit button set to just submit the page, and I have created a process that runs "On submit - after computations and validations" whose executed code is the following PL/SQL:

BEGIN
  FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
    BEGIN
      IF APEX_APPLICATION.G_F01(i) IS NOT NULL THEN
      run-some-procedure-function(
        parameter_one => APEX_APPLICATION.G_F01(i),
        parameter_two => :SOME_VALUES_ID,
        parameter_three => :F_AU_ID
      );
      END IF;
      EXCEPTION WHEN DUP_VAL_ON_INDEX THEN NULL;
    END;
  END LOOP;
END;

When I run this App, mark some checkboxes, and hit the submit button I end up with an error message and a weird URL ending:

APEX Error on submit with checkbox values

Any ideas and/or suggestions are welcome, even a different approach to my problem (I just need to stick to checkboxes because I need that) is accepted.

Upvotes: 0

Views: 9668

Answers (1)

user989729
user989729

Reputation: 56

A few tips to track down the cause:

  1. Check the branch after you hit the Submit button. Do you branch to the same page or a different page?
  2. If the branch is okay, then as part of testing comment run-some-procedure-function in the process and see, just to make sure the function is not the cause of the error.

Upvotes: 1

Related Questions