Home » Developer & Programmer » Forms » unattach LOV based on SYSTEM.MODE
unattach LOV based on SYSTEM.MODE [message #158404] Fri, 10 February 2006 10:41 Go to next message
bdrufner
Messages: 42
Registered: August 2005
Location: Home of the Mardi Gras, N...
Member
Forms 9.0.4 (32 bit), RDBMS 9.0.2

I am new to Oracle Forms.

I have an ITEM trigger (when-new-item-instance) that based on the value of SYSTEM.MODE attaches a LOV to an item. It works ok.

What I would like to do is if SYSTEM.MODE evaluates to NORMAL and a LOV is attached to the item in question is UNATTACH the LOV.

It have done some web and manual searching, but I am not getting anywhere. I have attached the trigger below:

begin

	if :system.mode = 'ENTER-QUERY' then

	    -- test to see if LOV is attached to text item
		if get_item_property('db_hrt_class.class_end_date',LIST) = 'FALSE' then
		 	
	    -- if not attached, attach LOV
			set_item_property('db_hrt_class.class_end_date', LOV_NAME, 'lov_class_end_date');
	 	
		end if;

	elsif :system.mode = 'NORMAL' then
	 	 
	  -- test to see if LOV is attached to text item 
		if get_item_property('db_hrt_class.class_end_date',LIST) = 'TRUE' then		

		  -- if attached, unattach LOV
		  message('need syntax to unattach LOV');

		end if;
		  
	end if;

end;


Any help, comments, suggestions, syntax, etc is appreciated.

Thanks in advance.

Barry
Re: unattach LOV based on SYSTEM.MODE [message #158671 is a reply to message #158404] Mon, 13 February 2006 19:36 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you tried the following?
set_item_property('db_hrt_class.class_end_date',LOV_NAME,null);

David
Re: unattach LOV based on SYSTEM.MODE [message #158794 is a reply to message #158404] Tue, 14 February 2006 07:54 Go to previous messageGo to next message
bdrufner
Messages: 42
Registered: August 2005
Location: Home of the Mardi Gras, N...
Member
David,

First, thanks for the feedback.

Actually, I did try the suggested code prior to hitting the ORAFAQ board for help but received the following error message on compile of the trigger:

"too many declarations of SET_ITEM_PROPERTY match this call"

I am new to FORMS and I am not sure what that means. Assumed there was a problem with passing a null argument to this built-in or that it was restricted in some other way.

Any other ideas or comments are appreciated.

Thanks in advance.

Barry
Re: unattach LOV based on SYSTEM.MODE [message #158799 is a reply to message #158794] Tue, 14 February 2006 08:08 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
NULL has in fact no data type, perhaps that's your problem. I've got no Forms around so I can't test it right now but could you try something like:
set_item_property('db_hrt_class.class_end_date',LOV_NAME,TO_CHAR(null));


Just a long shot though...

MHE
Re: unattach LOV based on SYSTEM.MODE [message #158803 is a reply to message #158404] Tue, 14 February 2006 08:32 Go to previous messageGo to next message
bdrufner
Messages: 42
Registered: August 2005
Location: Home of the Mardi Gras, N...
Member
Thanks for your feedback.

Based on the feedback from this board, I "stumbled" upon a solution on how to pass a null value to this built-in and unattach an "attached" LOV based on SYSTEM.MODE. Please find the attached code.

set_item_property('db_hrt_class.class_end_date',LOV_NAME,'');

I tested this solution and looked at the tirgger execute via the debugger. Works well.

Thanks to all who helped me in this endeavor. Your help and comments were appreciated.

Barry
Re: unattach LOV based on SYSTEM.MODE [message #158865 is a reply to message #158803] Tue, 14 February 2006 16:02 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Maarten got in there ahead on me again. I still prefer the 'to_char(null)' to using double single quotes. Just call me old-fashioned.

David
Previous Topic: Two Big Problems Needs Professionals
Next Topic: Trapping Oracle Error in Forms overriding Forms Error
Goto Forum:
  


Current Time: Fri Sep 20 05:43:01 CDT 2024