Home » Developer & Programmer » Forms » FRM 41032: cannot set enabled attribute of current item B00.CB_EMAIL x 3 (merged)
FRM 41032: cannot set enabled attribute of current item B00.CB_EMAIL x 3 (merged) [message #410867] Tue, 30 June 2009 17:50 Go to next message
s.vishalkumar@gmail.com
Messages: 22
Registered: July 2007
Junior Member
Hi Folks,

I am getting the error as shown below in the screenshot. I just changed the background of the form. It was dark in color, so I changed it to brighter colors and pasted everything inside the rectangular boxes. There was no change in the code.

Please could you let me know, what could be the reason for this error?

I have also attached the screenshot of the error in the attachments below.

Thanks in advance,
Vishal
PROCEDURE set_user_access IS
 
  tcnt number;
  rval number;
 
BEGIN
 
  -- get username from application
  :b00.user_login := get_application_property(username);
 
  -- get access level from segment_user
  select access_level
  into :b00.acc_level
  from segment_user
  where user_login = :b00.user_login;
 
  -- limit oc access
  -- level 1 & 2 users have access to all OCs
  if :b00.acc_level in ('1','2') then
  	:b00.user_oc   := 'ALL';
  elsif :b00.acc_level in ('3','4','5','6') then
  	
    -- all other users only have access to OCs specified in SEGMENT_USER_ATTRIB table
    SELECT COUNT(*)
    INTO TCNT
    FROM SEGMENT_USER_ATTRIB
    WHERE USER_LOGIN = :B00.USER_LOGIN
    AND   ATTRIB_ID  = 'OC';
  	
    IF TCNT > 0 THEN
      :b00.user_oc := 'SELECT';
    ELSE
      :B00.USER_OC := 'NONE';
    END IF;
 
  else
    :B00.USER_OC := 'NONE';
  end if;
  
  --set the email feature
/* not yet!  8/11/03 */
/* TDK: Enabled 1/9/04 */
  select COUNT(*)
  into :b00.email_addr_cnt
  from segment_user_email
  where user_login = :b00.user_login;
 
  if :b00.email_addr_cnt > 0 then
 
  ------------------  
  	SET_ITEM_PROPERTY('b00.cb_email',ENABLED,PROPERTY_TRUE);
	
----------------------------
 
    if :b00.email_addr_cnt > 1 then
    	:b00.email_addr := 'choose...';
    	
 	    rval := populate_group('RG_USER_EMAIL_ADDR');
      populate_list('B01.LI_EMAIL_ADDR', 'RG_USER_EMAIL_ADDR');
      :b01.li_email_addr := get_list_element_value('b01.li_email_addr',1);
 
    else
    	select email
    	into :b00.email_addr
    	from segment_user_email
    	where user_login = :b00.user_login;
    end if;
    
  else
  	SET_ITEM_PROPERTY('b00.cb_email',ENABLED,PROPERTY_FALSE);
  	SET_ITEM_PROPERTY('b00.cb_email',TOOLTIP_TEXT,'You do not have access to this feature, Please contact the system administrator to change your privileges.');
  end if;
 
  -- allow restricted rebate access?
  select count(*)
  into tcnt
  from segment_user_attrib
  where user_login = :b00.user_login
  and   attrib_id  = 'RSTRREB'
  and   nvl(attrib_value,'N') = 'Y';
  
  -- if have restricted access, show checkbox
  if tcnt > 0 then
 
    :b00.rstr_access := 'Y';
    :b00.rstr_ok     := 'Y';
 
  else
  	:b00.rstr_access    := 'N';
  	
  	-- hide checkbox
  	set_item_property('b00.rstr_ok',visible,property_false);
  	:b00.rstr_ok     := 'N';
  	
  end if;
 
END;


[EDITED by LF: applied [code] tags to preserve formatting]

[Updated on: Wed, 01 July 2009 00:25] by Moderator

Report message to a moderator

Re: FRM 41032: cannot set enabled attribute of current item B00.CB_EMAIL x 3 (merged) [message #410899 is a reply to message #410867] Wed, 01 July 2009 00:29 Go to previous message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Debug your code - if Forms version you use supports it, even better. Otherwise, put MESSAGE - PAUSE pairs into the procedure in order to follow its execution.

A suspicious line might be
SET_ITEM_PROPERTY('b00.cb_email',ENABLED,PROPERTY_FALSE);
which is about to fail if the current item (before the procedure was executed) was 'b00.cb_email'. Forms complains that you can not "disable" it if the focus is in that very item. Therefore, you should first move out (GO_ITEM) and then set its "enabled" property to FALSE.
Previous Topic: help me
Next Topic: OG.PLL
Goto Forum:
  


Current Time: Fri Apr 26 19:20:00 CDT 2024