Through Apex Item Checkbox checks want to store values in Item field

1.1k views Asked by At

I used Interactive report APEX_ITEM.CHECKBOX2(p_idx => 1, p_value => ST.ID, p_attributes => DECODE(ST.IS_HEADER_ROW ,'Y', 'DISABLED',NULL)). enter image description here And I want to use highlighted IDs depending upon checks in Row ID field in Comma delimited format DYNAMICALLY.

Further I will use that Row IDs value in another region report and will update values in DB after few validations.

2

There are 2 answers

7
Scott On BEST ANSWER

On button press, you could run this JavaScript which concatenates all nominated checkboxes into a delimited string.

$s('P1_ROWIDS',
  $("[name='f01']").map(function(){
     return this.value;
  }).get().join(",")
);

Then use the following query to find all the records matching values in that string using this, or your version's equivalent.

select * from your_table
where id in (select column_value from apex_string.split(:P1_ROWIDS))

This can all happen without submitting the page.

1
Anshul Ayushya On

Below code will fetch only those IDs which are checked in checkbox in comma delimited format (Note: this can be included in DA on any button which should be clicked after selection of multiple rows via checkbox)

$s('P11_ROW_PK', $("[name='f01']:checked").map(function(){ return this.value; }).get().join(","));