Skip to Main Content
  • Questions
  • Forms In Developer & Items Property Function

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Mohammed.

Asked: March 12, 2001 - 4:08 am UTC

Last updated: June 11, 2004 - 4:15 pm UTC

Version: 6.0

Viewed 10K+ times! This question is

You Asked

Dear Mr.Tom

Good Morning .

Well I have two Question .

1-
Some of my friend accomplished a project using Developer and he is using about 50 Forms *. Fmb .
My question here is about Performance ,What if he compress his 50 forms to 5 or 10 forms by separating other Forms in Blocks and canvases in the 5 or 10 forms(Moudles).

My Question again which is better to have many forms or one Form contains many blocks instead of many forms ?

2-
When I am using the function set_item_property(it_id , property , Property_true OR property_false)

I use instead of Property TRUE Or FALSE a string of varchar2(20) and I call this function by Procedure .But it does not work I have this Error FRM-41046 :invalid Parameter used for ste_item_property .


The calling Procedure is :

Enabling_disenabling_item('false');

The Procedure is:

PROCEDURE Enabling_disenabling_item(state in varchar2 )IS

it_id1 item;
it_id2 item;
it_id3 item;
it_id4 item;
it_id5 item;
it_id6 item;
enabled_value varchar2(20);

x number;

BEGIN
If state = 'true' then
enabled_value := 'property_true';
else
enabled_value := 'property_FALSE';
end if;

it_id1 := find_item('toolbar.delete_record');
set_item_property(it_id1,ENABLED,enabled_value);

it_id2 :=find_item('toolbar.previous_block');
set_item_property(it_id2,ENABLED,enabled_value);

it_id3 := find_item('toolbar.previous_record');
set_item_property(it_id3,Enabled,enabled_value);

it_id4:=find_item('toolbar.Next_Block');
set_item_property(it_id4,Enabled,enabled_value);

it_id5 :=find_item('toolbar.next_record');
set_item_property(it_id5,enabled,enabled_value);

it_id6 :=find_item('toolbar.insert_record');
set_item_property(it_id6,enabled,enabled_value);
end;

My Question Is How can I use this function :
set_item_property(it_id , property , Property_true OR property_false)
to accept string value as my procedure above work ?


Best wishes,



and Tom said...

1) from a performance perspective, there should be no difference once the form is opened. It will of course take longer to do a call_form or open_form then to just display a canvas in one large form.

there is the trade off between being able to modularize your code and manage small chunks and the initial hit your end user will take doing the open form. I myself would probably prefer many forms over one monolithic one.

2) the property_true/false are NUMBERS not strings.

declare
...
enabled_value NUMBER;
begin
If state = 'true' then
enabled_value := property_true;
else
enabled_value := property_FALSE;
end if;
.....




Rating

  (4 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

when ever you want answer just ask Mr TOM

Mohammed Al-moayed, March 12, 2001 - 1:13 pm UTC

Well I think that Mr tom is ding his best for answering the
Question for all individuals in the world, and the answers are Very good and confident, and I really thank him and all his coworkers.


Review in Forms In Developer & Items Property Function

Mohammed Al-moayed, March 12, 2001 - 1:15 pm UTC

Well I think that Mr tom is ding his best for answering the
Question for all individuals in the world, and the answers are Very good and confident, and I really thank him and all his coworkers.


SOS - Need your help

Nayan J. Sarma, June 11, 2004 - 9:19 am UTC

Hi Tom,
I'm working with Forms6i and having this strange problem.
I've a form with multiple canvases all on the same window. CNV_main is the content canvas and rest are

all stacked canvases (STK_CNV1 to STK_CNV5). The navigation to these canvases are done conditionally.
Before modifying this form everything was working perfectly.
I added a new Radio Group with 6 radio buttons in STK_CNV3 and resized it to fit the group. The form ran

perfectly showing everything correctly & the navigation was also fine.
THen I added a few lines of code to an already existing procedure, which is called from the

WHEN-NEW_FORM_INSTANCE trigger to hide a set of fields conditionally

------------------------------------------
PROCEDURE L_SET_FIELDS IS

BEGIN

IF :GLOBAL.M_PARA_1 = 'RES' THEN

SET_ITEM_PROPERTY('OAS_FM_CHARGE_CODE' , VISIBLE,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_FM_CHARGE_CODE' , ENABLED,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_TO_CHARGE_CODE' , NAVIGABLE,PROPERTY_FALSE);

SET_ITEM_PROPERTY('OAS_TO_CHARGE_CODE' , VISIBLE,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_TO_CHARGE_CODE' , ENABLED,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_TO_CHARGE_CODE' , NAVIGABLE,PROPERTY_FALSE);

SET_ITEM_PROPERTY('OAS_CHARGE_AREA_NUM', VISIBLE,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_CHARGE_AREA_NUM', ENABLED,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_CHARGE_AREA_NUM', NAVIGABLE,PROPERTY_FALSE);

-- THese 3 are the new lines added, the following Item is a check box in the content canvas

SET_ITEM_PROPERTY('OAS_FORCE_PARTY_CODE_YN_NUM', VISIBLE, PROPERTY_TRUE);
SET_ITEM_PROPERTY('OAS_FORCE_PARTY_CODE_YN_NUM', ENABLED, PROPERTY_TRUE);
SET_ITEM_PROPERTY('OAS_FORCE_PARTY_CODE_YN_NUM', NAVIGABLE, OPERTY_TRUE);


ELSIF :GLOBAL.M_PARA_1 = 'CAA' THEN

SET_ITEM_PROPERTY('OAS_FM_REASON_CODE' , VISIBLE,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_FM_REASON_CODE' , ENABLED,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_FM_REASON_CODE' , NAVIGABLE,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_TO_REASON_CODE' , VISIBLE,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_TO_REASON_CODE' , ENABLED,PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_TO_REASON_CODE' , NAVIGABLE,PROPERTY_FALSE);

-- THese 3 lines are also added afresh

SET_ITEM_PROPERTY('OAS_FORCE_PARTY_CODE_YN_NUM', VISIBLE, PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_FORCE_PARTY_CODE_YN_NUM', ENABLED, PROPERTY_FALSE);
SET_ITEM_PROPERTY('OAS_FORCE_PARTY_CODE_YN_NUM', NAVIGABLE, PROPERTY_FALSE);

END IF;
END;
--------------------

After this whener I tried to run the form, the form will exit automatocally whever we try to navigate to

the STK_CNV3, explicitly using the SHOW_VIEW() built-in, or implicitly.

It is navigating fine among all other canvases.

To further investigate into the problem, I took a dump of the forms runtime navigation and events using

the Forms Runtime Diagnostics and this is what I found out...

-----------------------------------------------------------------------
Executing FIND_VIEW Built-in:
In Argument 0 - Type: String Value: STK_CNV3
Out Argument 0 - Type: Integer Value: 4

Executing SET_VIEW_PROPERTY Built-in:
In Argument 0 - Type: Integer Value: 4
In Argument 1 - Type: Number Value: 1401
In Argument 2 - Type: Oracle Number Value: 4.000000
In Argument 3 - Type: Oracle Number Value: 0.000000

# OM3028:OM_OPERATIONS_ACNT_SETUP.OAS_TO_TXN_CODE
ERROR FORMS_ERROR "Forms encountered unexpected signal -1073741819"
-----------------------------------------------------------------------

I searched for a solution in google.com where I found out that its a Windows XP specific problem. well,

I'm running the form on Windows XP, but even after restarting my system, the problem remained same.

Now I'm all at sea... please help me out.


Tom Kyte
June 11, 2004 - 4:15 pm UTC

sorry, haven't touched forms in going on 9 years -- wait, more than 9 years.

sorry -- try the discussion forums on otn.oracle.com

count items on canvas

Veera babu, October 17, 2008 - 8:06 am UTC

Hi tom,
i want count the number of items are there on canvas.
i don't want canvas is null items, i wrote this code
i have so many colums are there. please tell me simpaly way
DECLARE
tmp_lstqry VARCHAR2(10000) := :System.Last_Query;
tmp_index NUMBER:=0;
tmp_where VARCHAR2(10000);
lvcanvas varchar2(200);
I NUMBER:=1;
curr_item varchar2(200) := :GLOBAL.FIRST_ITEM1;
lvitem_type varchar2(200);
lvattrb1 varchar2(200);
lvattrb2 varchar2(200);
lvattrb3 varchar2(200);
lvattrb4 varchar2(200);
lvattrb5 varchar2(200) := NULL;
lvattrb6 varchar2(200) := NULL;
lvattrb7 varchar2(200) := NULL;
lvattrb8 varchar2(200) := NULL;
lvattrb9 varchar2(200) := NULL;
lvattrb10 varchar2(200) := NULL;

BEGIN
tmp_index:= NVL(INSTR( tmp_lstqry,'WHERE'),0);
if tmp_index<>0 then
tmp_where := SUBSTR(tmp_lstqry, tmp_index + 6);
else
tmp_where:= tmp_lstqry;
end if;
go_block('APL');
FIRST_RECORD;
GO_ITEM( curr_item );
curr_item := :GLOBAL.FIRST_ITEM1;
--message(:GLOBAL.LAST_ITEM1);pause;
LOOP
I:=1;

LOOP

lvcanvas := get_item_property(curr_item,item_canvas);
IF lvcanvas IS NOT NULL THEN

lvitem_type := get_item_property( curr_item,item_type);

IF lvitem_type<>'BUTTON' AND lvitem_type<>'CHART ITEM' AND lvitem_type<>'CHECKBOX' AND lvitem_type<>'OLE OBJECT' THEN
curr_item := :System.Cursor_Item;
if i=1 then

lvattrb1:= get_item_property(curr_item ,DATABASE_VALUE);

elsif i=2 then
--lvattrb2 := curr_item ;
lvattrb2:= get_item_property(curr_item ,DATABASE_VALUE);

elsif i=3 then
--lvattrb3 := curr_item ;
lvattrb3:= get_item_property(curr_item ,DATABASE_VALUE);

elsif i=4 then
--lvattrb4 := curr_item ;
lvattrb4:= get_item_property(curr_item ,DATABASE_VALUE);

elsif i=5 then
--lvattrb5 := curr_item ;
lvattrb5:= get_item_property(curr_item ,DATABASE_VALUE);

end if;

end if;

end if;
EXIT WHEN (curr_item=:GLOBAL.LAST_ITEM1);
IF i=5 Then
EXIT;
ELSE
i := i+1;
END IF;

next_item;
curr_item := :System.Cursor_Item;

End LOOP;

INSERT INTO log_tables VALUES(:GLOBAL.SCREEN, :GLOBAL.TAB,:GLOBAL.CURR_CANVAS,:GLOBAL.iv_client_ip ,:GLOBAL.server_ip,lvattrb1 ,lvattrb2,lvattrb3,lvattrb4,lvattrb5,lvattrb6,lvattrb7,lvattrb8,lvattrb9,lvattrb10,tmp_where);
COMMIT;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;

END LOOP;
EXCEPTION
WHEN OTHERS THEN
Message('HI '||SQLERRM);pause;
END;

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library