Sunday, September 23, 2012

How to Check Only One Item In a Check Box ?

Hello Redars, How are you ?

Here i will share a tricky PL/SQL code with you. If you want to use Check Box in oracle forms and want to restrict end user to select only one check box, how will you handle this ?

Just customize the following code and you will get the result.

declare
  l_current_record number;
  l_last_record    number;
begin
  l_current_record := :system.trigger_record;

  last_record;
  l_last_record := :system.cursor_record;
 
  first_record;
   
  for i in 1 .. l_last_record loop
    if :system.cursor_record <> l_current_record then
       :SM_ACT_FLAG := 0;
    end if;
    next_record;
  end loop;
 
  go_record(l_current_record);
end;

If you have any question regarding this..just leave comments and i will answer.

4 comments:

  1. Thank you very much. It's helped me a lot.

    ReplyDelete
  2. Sir plz tell me differnces bitween trigger_record and cursor_record??

    ReplyDelete
  3. i have a question
    i m having set of check box in a block,i should select only first check box from set of check boxes .
    now my problem is it allowing other check boxes also to select

    ReplyDelete