Home » Developer & Programmer » Forms » find visual_attribute item (oracle forms 6i, windows)
find visual_attribute item [message #648860] Sat, 05 March 2016 03:20 Go to next message
yeahia
Messages: 22
Registered: June 2010
Location: Bangladesh
Junior Member
hi,
i want to use find_va function so that if the visual attribute exists or not.
i use it like this:
declare
rl_id varchar2(100);
begin
 rl_id:=find_va('LOV_ITEM');
IF Id_Null((rl_id) THEN
 SET_ITEM_INSTANCE_PROPERTY(item_name,current_record,visual_attribute,'LOV_ITEM')
END IF;
END;

while i compile then en error shows:
expression is of wrong type
statement ignored.

question:
what will be the datatype of rl_id
or how it will be solved
thanks
Re: find visual_attribute item [message #648869 is a reply to message #648860] Sat, 05 March 2016 10:32 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
FIND_VA built-in searches for the visual attributes of an item in a given block and returns the value of that attribute as a text string.

ID_NULL returns a Boolean value that indicates whether the object ID is available.

You pass VARCHAR2 to ID_NULL, and it expects an object ID instead.

Therefore, I guess that simple
if rl_id is null then
   set_item_instance_property ...
end if;
might solve the problem.

[Updated on: Sat, 05 March 2016 10:33]

Report message to a moderator

Re: find visual_attribute item [message #648875 is a reply to message #648869] Sat, 05 March 2016 23:15 Go to previous messageGo to next message
yeahia
Messages: 22
Registered: June 2010
Location: Bangladesh
Junior Member
Thanks for your prompt suggestion. but when i want to complie it gives below error:

declare
rl_id varchar2(100);
begin
 rl_id:=find_va('LOV_ITEM');
IF rl_id is null THEN
 SET_ITEM_INSTANCE_PROPERTY(item_name,current_record,visual_attribute,'LOV_ITEM')
END IF;
END;

WHEN COMPILE IT SHOWS:

Error 382 at line 13, column 12
 expression is of wrong type
Error 0 at line 13, column 5
 Statement ignored


The cursor blinks in find_va('LOV_ITEM').

Thanks in advance for solving.
Re: find visual_attribute item [message #648876 is a reply to message #648875] Sun, 06 March 2016 00:29 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, I'd rather test it first, then respond to a question. Sorry.

We both missed the correct datatype - it is the VISUALATTRIBUTE. Your code - which will, hopefully, work - should look like this:
declare
  rl_id visualattribute;
begin
  rl_id := find_va('LOV_ITEM');

  if id_null (rl_id) then
     ...
  end if;
end;
Re: find visual_attribute item [message #648877 is a reply to message #648876] Sun, 06 March 2016 00:38 Go to previous message
yeahia
Messages: 22
Registered: June 2010
Location: Bangladesh
Junior Member
Thanks. Thanks.
That was I actually asked before.
Problem solved.
Previous Topic: Personalization
Next Topic: Please Help : Creating dynamic Menu
Goto Forum:
  


Current Time: Tue Apr 16 05:51:51 CDT 2024