GET_FORM_PROPERTY
I have a custom form built in Oracle and I have created a new function for query only purposes with query_only='yes'.
Based on whether form opened in query only mode, I need to flag a variable inside the form so that based on the flag, I need to compute formulas based on that.
If form opens in 'query_only=yes, computation is different. If form opens in standard mode, computation is different.
I have variable defined that handles the calculation but I cannot get the query_only mode inside the form.
I'm not working on system.current_form but I'm looking for other formsYes, of course...i know..you have explained it thorougly...!!!!
I 'm just thinking of using FIND_FORM using the :system variable....
For loops of forms the :system.current_form takes a form each time.... doesn't it..???
So....
FUNCTION GET_NUM_FORM_APERTI RETURN NUMBER IS
MAXOPENED PLS_INTEGER := 100;
FORMCOUNT PLS_INTEGER := 0;
TESTFORM FORMMODULE;
NOMFRM formmodule;
ESISTE BOOLEAN;
BEGIN
FOR I IN 1..MAXOPENED
LOOP
TESTFORM.ID := I;
ESISTE := TRUE;
BEGIN
NOMFRM := Find_Form(:System.Current_Form);
IF (NOT FORM_SUCCESS)
THEN
ESISTE := FALSE;
END IF;
EXCEPTION
WHEN OTHERS
THEN
ESISTE := FALSE;
END;
IF ESISTE AND NOMFRM IS NOT NULL
THEN
FORMCOUNT := FORMCOUNT + 1;
END IF;
END LOOP;
RETURN FORMCOUNT;
END;The code in bold marks the different code....!!!!
Regatds,
Simon
Similar Messages
-
How can i find out the Location of fmx file in the forms
Hi,
I want to find out the drive name,WHich Contains Fmx file. How can i find it out(at run time) .
It should be found inside the form.So that i can pass it as a parameter to a Procedure.
Thanlks in advance.
regards,
Alok Dubeyhi,
if you are using Client/Server forms with d2kwutil then this should return form full name :
win_api_environment.get_working_directory() || get_form_property(:System.Current_Form,FILE_NAME)
engin. -
How to use a Template in reports as in Forms ?
Goal:
I need to use reuse a common code in all of my reports.
Current scenario:
I need to display Report title, database name and report REP file name in the header of each report. So if I change at one place it should be reflected at all he places I refer this code.
P.S. I have a table which stores report file name and title in report.
Questions:
1) Is there a way to know the REP file name in the report like we have in the form GET_FORM_PROPERTY ?
(Because once I know the rep file name I can search in my table to fetch the description, as I don't want
to hard-code the REP name anywhere in the code)
2) Getting the database name is not a problem, I can always query v$database or v$instance to get the db name.
2) Where can I put this code so that I can refer the same code in all the reports, like the way we do it in
the forms (by subclassing an object or object group from Template or a common form to individual form).
Thanks
MeharThanks very much. Get_Report_name works.
But I have an additional problem:
The changes I make in the template, are not getting reflected in the report based on the template i.e. There is no more reference once I make a report based on the template unlike in forms where I can "keep the path" while subclassing any object from one form to another.
Is it the default bahaviour of using the template ? Or do I need to do something else ?
Thanks again,
Mehar -
Open Form not working when called from When-Mouse-Click
In our application to navigate to other forms we have created a feature where user selects the Forms from a LOV, the form id is returned to the text item and user needs to click the text item.....In the text item the Open form command is given
This is not working
The form builder throws an error
Frm 92100 Connection interupted
what could be the reasonCode written in When-Mouse-click
for item :boo_toolblk.nbt_nxtscr which contains the form id
DECLARE
p_name_id PARAMLIST;
lv_param_name VARCHAR2(8):= :boo_toolblk.nbt_nxtscr;
lf_next_form_id FORMMODULE;
BEGIN
Clear_Item;
/*Create a parameter list named 'TEMPLT_PARAM'. First
** make sure the list does not already exist, then
** attempt to create a new list*/
IF not Id_Null(Get_Parameter_List('TEMPLT_PARAM'))/*Returns a BOOLEAN value if the object ID is available*/
THEN Destroy_Parameter_List('TEMPLT_PARAM');
END IF;
p_name_id:= Create_Parameter_List('TEMPLT_PARAM');
/*Add a value parameter to an existing Parameter
** List */
Add_Parameter(p_name_id,'templt_nxtscr',TEXT_PARAMETER,lv_param_name);
Go_Block(Get_Form_Property(:system.current_form,FIRST_NAVIGATION_BLOCK));
lf_next_form_id := FIND_FORM(lv_param_name);
:PARAMETER.next_form := lv_param_name;
IF lf_next_form_id.id is not null
THEN
Close_form(lf_next_form_id);
END IF;
Add_parameter(p_name_id,'previous_form',TEXT_PARAMETER,:SYSTEM.CURRENT_FORM);
/* opens another form*/
Open_Form(lv_param_name,ACTIVATE,NO_SESSION,SHARE_LIBRARY_DATA,p_name_id);
EXCEPTION
WHEN FORM_TRIGGER_FAILURE
THEN RAISE FORM_TRIGGER_FAILURE;
WHEN OTHERS
THEN RAISE FORM_TRIGGER_FAILURE;
END;
Error :-
Frm-92100 : Your Connection to the Server was Interrupted
This may be the result of a networn error or a failure on the server.
You will need to re-establish -
Need to know the path of current Form/Report
Hi All,
I need to know the path of the Current Report/Form, but i dont want to use
get_form_property(:system.current_form,file_name),
is their any other way for getting the current path from where the report/form is running
Imran AhmedHi,
I dont want to use
get_form_property(:system.current_form,file_name)
because it give me the current directory with the form name for eg. (c:\dev6i\temp\abc.fmx) then i have to use
cur_file_name := get_form_property(:system.current_form,file_name);
total_length := length(cur_file_name);
cur_form_name_length := length(get_form_property(:system.current_form,form_name))+4;
path_length := total_length-cur_form_name_length;
cur_path:= substr(cur_file_name,1,path_length);
to get the actual path, and i dont find any function name GET_WORKING_DIRECTORY under WIN_API_ENVIRONMENT theie is get_windows_director and get_temp_directory but not the above, if you have that function then please mail me on [email protected] I also cannot use read_registry(forms_path) because in registry i have different paths.
Thank You -
Setting aplicattion name in .pll
Dear proffesionals,
what's the best way to set Aplication name at runtime - what is the practice which is use in your team ?
I tried to create procedure in pll as follows (username and conn string are useful when users sent etc. print screen):
PROCEDURE set_app_name IS
vc_conn_string VARCHAR2(1000); -- used for creating parameter form
vc_conn_user VARCHAR2(100); -- used for creating parameter form
vc_conn_user_string VARCHAR2(100); -- used for creating parameter form
curform VARCHAR2(40);
blkname VARCHAR2(40);
begin
curform := :System.Current_Form; --cannot use :system variables !!!
blkname := Get_Form_Property(curform,FIRST_BLOCK);
vc_conn_string:=get_application_property(connect_string);
vc_conn_user:=get_application_property(username);
vc_conn_user_string:=vc_conn_user||'@'||vc_conn_string;
set_window_property ('window0',Title,vc_conn_user_string);
set_window_property (forms_mdi_window,title,'My application');
--set_window_property (forms_mdi_window,title,'My application name ');
END;When try to compile, i got this error:
PL/SQL ERROR 49 at line 8, column 13
bad bind variable.... ''So, how to find out current form name ?
Thanks in advance,
Adnan
AS: 10.1.3
Forms&Rep: 10.1.2.3.0
DB: 10.2.0.1.0adnanBIH wrote:
Sorry, i don't understand how that function could help me - as i said before, i couldn't use global or system variables in .pll functions or procedures....Of course you can...with the help of the name_in built in:
curform := name_in('System.Current_Form'); -
Retrieve Current Report File Name
i am using Forms and Reports 6i.
in Forms, i am using the following statement to get the current form name -
GET_FORM_PROPERTY (:system.current_form, FILE_NAME)
i didn't find a similar statement in report to get the report file name,
plz help...Hello,
You will have more chance to get an answer by sending this question in the Reports forum.
Francois -
How can I get the list of all canvas in the forms programatically?
I want an exemple of how to do it. I really need it to put in a template.
This is the code.
You will see how to loop through every item of every blocks of the form:
PROCEDURE Get_Canvas_Names IS
lc$blockDeb varchar2(60); -- start block
lc$block varchar2(60); -- current block name
lc$item varchar2(60); -- current item
lc$Type varchar2(20); -- item type
lc$itemdeb varchar2(60); -- first item
lc$canvas varchar2(60); -- current canvas name
lc$tabcan varchar2(60); -- current tab canvas name
lc$Acanvas varchar2(60):= ' '; -- old canvas name
lc$Atabcan varchar2(60):= ' '; -- old tab canvas name
ln$NbRec pls_integer := 0 ; -- number of records (for know if the block is multi-records)
BEGIN
LC$BlockDeb := get_form_property( NAME_IN('System.Current_Form'), FIRST_BLOCK ) ;
LC$Block := LC$BlockDeb ;
Loop -- For each block of the form
LN$NbRec := get_block_property(LC$BLOCK, RECORDS_DISPLAYED) ;
lc$itemdeb := get_block_property(LC$BLOCK, FIRST_ITEM) ;
lc$item := LC$BLOCK || '.' || lc$itemdeb ;
while lc$itemdeb is not null loop -- For each item
-- visible item ? --
IF GET_ITEM_PROPERTY(LC$Item , VISIBLE) = 'TRUE' Then
-- Get the canvas and tab canvas name --
lc$canvas := GET_ITEM_PROPERTY(LC$Item , ITEM_CANVAS ) ;
lc$tabcan := GET_ITEM_PROPERTY(LC$Item , ITEM_TAB_PAGE ) ;
End if ; -- GET_ITEM_PROPERTY(LC$Item , VISIBLE) = 'TRUE'
lc$itemdeb := get_item_property(lc$item, NEXT_NAVIGATION_ITEM );
lc$item := LC$BLOCK || '.' || lc$itemdeb ;
end loop ;
LC$Block := get_block_property( LC$Block, NEXTBLOCK ) ; -- next block
exit when LC$Block is null ;
End loop ;
END Get_Canvas_Names;all you have to do is to save each different canvas names in a pl/sql table.
Francois -
How to find the First block....in a multi block form
hi
How i can find which is the first block in a multi block form....
( there are n number of forms with multi blocks...so
i need to generalise the code to find the first block in all of
the forms)
regards
KrisIf you searched in the on-line help for "First", you would find that the Get_Form_Property built-in provides two: First_Block and First_Navigation_Block.
-
Form fields just a block of black print
I am completing a form online but when printing the fields that has no text in them print out in solid black blocks of ink. Why is this happening?
HI,
some tips:
"I'll need a list of fields within the block which the cursor is in"
More generally, you can get the first block of your form using... "GET_FORM_PROPERTY(<your_form>,first_block)"
To get the first the first item of the specified block....
"GET_BLOCK_PROPERTY(block_name,first_item)"
then loop through all items of your block
"GET_ITEM_PROPERTY(item_name,nextitem)"
and if you want to exclude some item types such as buttons....
if GET_ITEM_PROPERTY(item_name,item_type)<>'BUTTON'
Greetings,
Sim -
Identify data blocks in a form at runtime
At form runtime, how can I know which data blocks or canvasses are used by the current form? For instance, a form was designed to have 2 data blocks and a canvas, at runtime, is there a way for me to identify all data blocks and canvas that the form is using?
Hi,
Using the system variables, you can get information about the current form and blocks. Using the built-in Get_Form_Property ( I think that is the correct name), you can find the first block. Then using the get_block_property, you can find the next block from there. Just loop through this until there is no more data. I believe on of the block properties will give you the canvas it is on.
Hope this helps,
Jamie -
Hi all,
I'm back again in Forms forum : ) !!! and I'm working on a new and very interesting project
version used : Forms [32 bits] Version 10.1.2.3.0 (Production)
A little question for gurus :
On former projects I used to call loops on blocks and item like shown below to do various things such as displaying buttons or showing canvas or different VA depending on the user or scenarios .
PROCEDURE FRM_BLK_ITM_LOOP IS
v_curblk varchar2(90); -- bloc courant
v_curitm varchar2(90); -- item courant
BEGIN
v_curblk := get_form_property(:SYSTEM.CURRENT_FORM,first_block); -- on récupère le 1er block de la form
LOOP
v_curitm := v_curblk||'.'||get_block_property(v_curblk,first_item); -- on récupère le 1er item du block
WHILE v_curitm != v_curblk||'.'||get_block_property(v_curblk,last_item)
LOOP -- tant que l'item n'est pas le dernier du block on loop
v_curitm := v_curblk||'.'||get_item_property(v_curitm,nextitem); -- on récupère l item suivant
if get_item_property(v_curitm,<some property>) = 'TRUE' then
--- I can do something.... or adding more conditions if then etc...
end if;
END LOOP;
EXIT WHEN v_curblk = get_form_property(:SYSTEM.CURRENT_FORM,last_block); -- on sort losrqu on arrive au dernier block
v_curblk := get_block_property(v_curblk, nextblock); -- on passe au block suivant
END LOOP;
END;In my current project we work on quite huge forms which can have a consequent number of blocks and items.
And we must be very careful regarding performance issues as these forms are accessed via LAN and WAN.
So my question :
This method seems to be quite efficient as it goes thrue blocks and items sequences as they are defined in the builder comparing to go_block -> go_item ->do_something which can easily turn into nightmare-programming.
But I don't really know about network roundtrips with this kind of method.
Is everything done in the app server and then fetched to the client?
What triggers block-level and item-level can be fired during the execution of the loop ? and so one...
Thanks in advance for your advices on this matter.
Jean-YvesHmmm, I have to say I never bothered if Forms is in Socket mode or not; I enabled the network statistics, counted the roundtrips and looked for ways to get them lower (my old friend wireshark did also a good job regarding this) ;). But regarding the note Forms 6i uses Socket Connections by default, this might apply to 10g too (or the enhancement request was approved, who knows).
Frankly I am not entirely sure what Socket Mode means; I guess it's the mode the forms applet talks to the forms runtime; wheter it's stateful (via Sockets) or stateless (via HTTP / HTTPS) but this is just a wild guess, and I can't find informations on it quickly. I also enabled networkStats on my Developer Suite only, so I cannot tell if you can enable them on a full-fledged Application Server.
Anyway; as said I just counted the roundtrips and looked where I can avoid them when I made our application ready for WAN.
Another useful tool was Shunra VE Desktop which I used to simulate low bandwith networks with high latencys; I installed it on a virtual XP, started the application and tested how the Application performs. If something looked odd, I looked behind the scenes, built a little testform basing on the code behind and tried out various things; very often you can take advantage of the event bundling forms seems to make when you use several set_xyz calls as Francois also noted; e.g.
set_custom_property('bean_item', 1, 'PROPERTY', prop);
set_custom_property('bean_item', 1, 'PROPERTY', prop);
set_custom_property('bean_item', 1, 'PROPERTY', prop);
set_custom_property('bean_item', 1, 'PROPERTY', prop);
set_custom_property('bean_item', 1, 'PROPERTY', prop);
vRet := get_custom_property('bean_item', 1, 'PROPERTY);most certainly will cause just 1 roundtrip; but if you use get_custom_property in the middle of the set_custom_property calls you will encounter 2 roundtrips as forms needs to synchronize (you get a value from the bean so the forms runtime needs a response) with the forms applet whereas set_custom_property is a one-way-street which can be fired off simultaneous. The same applies to fbean.invoke and fbean.invoke_bool, fbean.invoke_char and the like. Of course if you are using more then one get_custom_property in this case the roundtrips will increase accordingly.
If you want to make use of event bundling make sure you fire off as much set_xyz as you can before forcing forms to synchronize (e.g. with get_xyz, or synchronize, create_timer,...)
cheers -
Experts Experience Are Required Here
Dear Sir,
I have copied this code from your article from oracle.com but I need to do one modification.
I want to send the form name to the procedure to retrieve all the information instead of opening each form.
Best regards
PROCEDURE Get_Canvas_Names IS
lc$blockDeb varchar2(60); -- start block
lc$block varchar2(60); -- current block name
lc$item varchar2(60); -- current item
lc$Type varchar2(20); -- item type
lc$itemdeb varchar2(60); -- first item
lc$canvas varchar2(60); -- current canvas name
lc$tabcan varchar2(60); -- current tab canvas name
lc$Acanvas varchar2(60):= ' '; -- old canvas name
lc$Atabcan varchar2(60):= ' '; -- old tab canvas name
ln$NbRec pls_integer := 0 ; -- number of records (for know if the block is multi-records)
BEGIN
LC$BlockDeb := get_form_property( NAME_IN('System.Current_Form'), FIRST_BLOCK ) ;
LC$Block := LC$BlockDeb ;
Loop -- For each block of the form
LN$NbRec := get_block_property(LC$BLOCK, RECORDS_DISPLAYED) ;
lc$itemdeb := get_block_property(LC$BLOCK, FIRST_ITEM) ;
lc$item := LC$BLOCK || '.' || lc$itemdeb ;
while lc$itemdeb is not null loop -- For each item
-- visible item ? --
IF GET_ITEM_PROPERTY(LC$Item , VISIBLE) = 'TRUE' Then
-- Get the canvas and tab canvas name --
lc$canvas := GET_ITEM_PROPERTY(LC$Item , ITEM_CANVAS ) ;
lc$tabcan := GET_ITEM_PROPERTY(LC$Item , ITEM_TAB_PAGE ) ;
End if ; -- GET_ITEM_PROPERTY(LC$Item , VISIBLE) = 'TRUE'
lc$itemdeb := get_item_property(lc$item, NEXT_NAVIGATION_ITEM );
lc$item := LC$BLOCK || '.' || lc$itemdeb ;
end loop ;
LC$Block := get_block_property( LC$Block, NEXTBLOCK ) ; -- next block
exit when LC$Block is null ;
End loop ;
END Get_Canvas_Names;Hello,
You can't. All these Forms built-ins can be applied only on the current form running in memory. There is no built-in that allows to read a Forms module that is not loaded in memory.
Francois -
Script to show forms label - table/column mapping
Hi,
Is there a script that reads a .fmb file and generates an output that shows what is the table/column behind every label/field ?
Appreciate your help.
Thanks,
Gopalthere is no script
maybe its easier to write a library with a procedure, which loops through all blocks and in the block through each item and get those data you need.
get_form_property (FIRST_BLOCK)
get_block_property (blockname, NEXTBLOCK)
get_block_property (blockname, FIRST_ITEM)
get_item_property (blockname, NEXTITEM)
try it
Gerd -
Hi!
We have a library procedure that accepts block id as parameter.
The procedure fetches some block realted information from the database. So, it needs to refer to the block name.
Is there any way find the block name from block id?
Rgds,
SBThis is pretty crude, but it will work. Maybe someone else can suggest a better way:
Function Block_Name(B Block) return varchar2 is
Blk_Nam varchar2(30);
Begin
Blk_Nam := Get_Block_Property(B,NextBlock);
If Blk_Nam is not null then
Blk_Nam := Get_Block_Property(blk_Nam,PreviousBlock);
Else
Blk_Nam := Get_Block_Property(B,PreviousBlock);
If Blk_Nam is not null then
Blk_Nam := Get_Block_Property(Blk_Nam,NextBlock);
Else --only one block in Form
Blk_Nam := Get_Form_Property(:System.Current_Form ,First_Block);
End if;
End if;
Return(Blk_Nam);
End;
Maybe you are looking for
-
How to transfer windows files from old macbookpro under bootcamp to new notebook
Hi all, I'm currently using both Mac OS and Windows XP on my macbookpro, and I'm buying a new one. I know how to transfer everything on the Mac OS, but how do I do so for the Windows part. Please advise. Thanks in advance!
-
A Long and Involved "Why isn't my iPod working?"
Hoooookay, so... My iPod is having problems. It's a second gen, but I did get the battery replaced about 9 months ago so I'm still ok on that front. Here's my problem: I haven't used it in a while (since before the iTunes 7 update), and while trying
-
JSP - LoadBundle and Component Error in Visual Design Editor
Hi. I've tried to make simple international JSF application. So the first thing to do was to externalize strings from JSP to resources. According to instructions from Java Studio Creator Field Guide Chapter 13: http://developers.sun.com/members/promo
-
Every time I boot up my Mac, and use Safari, everything goes well until I quit the app. About five seconds after quit, the icon starts bouncing again, and starts back up. I've tried rebooting, reinstalling Safari, and even wiping my entire OS clean!
-
Is it still possible to sell iPad1 to Apple Co. for the newest version?
See title