unattach LOV based on SYSTEM.MODE [message #158404] |
Fri, 10 February 2006 10:41 |
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 #158794 is a reply to message #158404] |
Tue, 14 February 2006 07:54 |
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 #158803 is a reply to message #158404] |
Tue, 14 February 2006 08:32 |
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
|
|
|
|