Deepika N
Deepika N

Reputation: 1

interactive grid select list without mentioning parent column

I have a column in Interactive grid as select list and the list should refresh based on from and to date. however there is a scenario where I dont want the select list to change when from and to date are changed. Is it possible ?

I tried dynamic action but it still refreshes as the select list expects cascading parent columns

Upvotes: 0

Views: 158

Answers (1)

Littlefoot
Littlefoot

Reputation: 142705

As Apex can't read your mind ("there is a scenario where I don't want the select list to change"), you'll have to instruct it - somehow - whether it should use "from" and "to" values which are currently set, or the ones you had previously.

To do that, create 3 additional items:

  • P1_DATE_FROM_PREVIOUS (hidden)
  • P1_DATE_TO_PREVIOUS (hidden)
  • P1_REFRESH (checkbox, radio button or a switch, having "Y" or "N" values)

Use dynamic actions on P1_DATE_FROM and P1_DATE_TO to set hidden items' values. P1_REFRESH will, if set to "Y" mean that you want to use "refreshed" date items' values; if set to "N", select list item's LoV query will use their "previous" values.

Something like this:

select name as display_value,
       id   as return_value
from some_table
where date_column between 
  case when :P1_REFRESH = 'Y' then :P1_DATE_FROM 
       else :P1_DATE_FROM_PREVIOUS
  end 
  and
  case when :P1_REFRESH = 'Y' then :P1_DATE_TO
       else :P1_DATE_TO_PREVIOUS
  end

Upvotes: 0

Related Questions