Wednesday, April 21, 2010
Sample Demo For My Private Under Development Application
http://www.4shared.com/file/xmie15qz/haythem_application.html
Tuesday, December 29, 2009
Flexible Contact query for all entities in your application

the screen is base on two blocks :
1- search block ( field for selecting the master database file i.e users , customers , operating units ..... etc another field for selecting the contact entity i.e the specified person or the specified customers )
2- the contact block that based on the contacts table to display the data according to the search criteria in the above block
the Implementation :
1- on your when new form instance trigger or your program unit that called in when new form instance trigger write the following code:
--- FILL THE MASTER FILE SEARCH WITH THE DATA
u_program_pkg.P_POPULATE_LIST('SERACH_BLK.MASTER_FILE','SELECT ARABIC_DESC,TABLE_NAME FROM GN_TABLE
WHERE ENABLE_CONTACT=1');
where the gn_Table is the table that keep the names of the tables of the system that designed to have contact , also this table contain the select statement for the id and the name of the entity to be used in the list of value to get the specified entity ( person , user , custoemr , supplier ,.... etc)
2- on when list changed of the above list item
vREG_ID RECORDGROUP;
vEXECUTE NUMBER;
BEGIN
vREG_ID := FIND_GROUP('flex_group');
IF NOT ID_NULL(vREG_ID) THEN
DELETE_GROUP(vREG_ID);
END IF;
vEXECUTE := POPULATE_GROUP_with_query(vREG_ID,:p_query);
set_lov_property('flex_lov',group_name,'flex_group'); to assign the used select statement for the selected master table in the list iem
3- now the list of values now assigned with the id and the name of the entity that you will select form to display the contacts assigned to this specified entity
Thursday, November 5, 2009
Get Online Currency Exchange Rates

first step for implementing this java bean is
1- put the jar file CurrencyExchange.jar in the path form
2- add the path of this jar file with the full name in the archivjinit paramter in your working section in the Fromsweb.cfg file
3-add the full path in step 2 also in classpath parameter in Default.env file
4- create new form and create a bean item and set its implementation class to
oracle.forms.jvr.CurrencyExchange
5- create items that hold from currency and to currency with the values of standard currency symbol
6- call the following code
fbean.invoke('yourblock.yourbean',1,'setFrom',:fromcurrencybindvariable);
fbean.invoke('yourblock.yourbean',1,'setTo',:tocurrencybindvariable);
:bindvariableforresult:=fbean.invoke_char('yourblock.bean',1,'change','');
the jar file link
http://www.4shared.com/file/146643242/9c8e15e6/CurrencyExchange.html
Sunday, September 6, 2009
Dynamic Import using sqlldr

v_load_directory varchar2(30);
V_FILE_TYPE UTL_FILE.FILE_TYPE;
v_directory_path varchar2(200) ;
v_file_name varchar2(50);
v_ext varchar2(3);
V_COL_LIST VARCHAR2(500);
V_SEP_POS NUMBER(3);
V_ORA_HOME VARCHAR2(500);
v_bat_file_name varchar2(500);
v_control_file varchar2(50);
if :table_name is null then
message('You Must Choose Table For Importing Process'); message('You Must Choose Table For Importing Process');
raise form_trigger_failure ;
end if ;
message('You Must Specify File Name You Want to Upload'); message('You Must Specify File Name You Want to Upload');
raise form_trigger_failure ;
end if ;
message('No Column Selected For Importing Process');message('No Column Selected For Importing Process');
raise form_trigger_failure ;
end if ;
v_load_directory:=sm_check_pkg.check_application_setting('LOAD_DATA_DIR');
v_directory_path :=sm_get_pkg.get_directory_path(v_load_directory);
v_file_name:=substr(:file_name,1,instr(:file_name,'.')-1) ;
v_ext:=substr (:file_name,-3) ;
V_ORA_HOME:=SM_CHECK_PKG.CHECK_APPLICATION_SETTING('DB_ORA_HOME');
V_COL_LIST:='';
For i IN 1 .. Get_List_Element_Count('SELECTED_COLS') Loop
V_COL_LIST:=V_COL_LIST','Get_List_Element_Value( 'SELECTED_COLS', i );
End loop ;
---V_SEP_POS:=INSTR(V_COL_LIST,',',-1);
-- CREATE TEH CONTROL FILE
v_control_file:=dbms_random.STRING('b',8)'.''ctl';
v_file_type:=utl_file.fopen(v_load_directory,v_control_file,'W');
UTL_FILE.putf(V_FILE_TYPE,'LOAD DATA'); -- first line
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,'INFILE ''''' v_directory_path'\':file_name''''); -- second line
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,'BADFILE ''''' v_directory_path'\'v_file_name'.''bad'''''); -- third line
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,'DISCARDFILE ''''' v_directory_path'\'v_file_name'.''dsc'''''); -- fourth line
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,:PREDATA_02);
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,'INTO TABLE ''"TMS"''.''"':TABLE_NAME'"');
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,'FIELDS TERMINATED BY '''''';''''');
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,'('V_COL_LIST')');
UTL_FILE.fclose(V_FILE_TYPE);
synchronize;
---- CREATE THE BATCH FILE
v_bat_file_name:=dbms_random.STRING('b',8)'.''bat';
v_file_type:=utl_file.fopen(v_load_directory,v_bat_file_name,'W');
UTL_FILE.putf(V_FILE_TYPE,'@echo on ');
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,'set oracle_home='v_ora_home);
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,'cd\');
UTL_FILE.new_line(V_FILE_TYPE); ------------------------------------------
UTL_FILE.putf(V_FILE_TYPE,v_ora_home'\bin\sqlldr.exe ' 'userid=tms/tms@hdb control='v_directory_path'\'v_control_file);
UTL_FILE.fclose(V_FILE_TYPE);
synchronize;
paragma_pkg.p_import_audit(info_pkg.get_current_user_id,v_control_file,v_bat_file_name);
end if ;
END;
Tuesday, August 25, 2009
Forms Dynamic Audit Program

Thursday, August 13, 2009
Before Starting ( Application Development and Desgin Standards)
1- You Should Comment your Tables and database objects to facilitate the understanding of the database design and reduce the cost of any future modification and facilitates the knowledge requested by any developer or desginer
2- You should comment your columns if needed to be cleared what is this column functionality is . ( if columns are commented , the developer will know in very easy way what this column is designed to , and whic values allowed & which symbol means )
3- Naming Convention for database objects and its attributes should be kept to facilitate the work process and make any common adjustments can be done.( suppose that you keep the naming convention of your tables to be prefixed by 2 letter_ and the table primary key column is composed of your table name without the prefeix and suffixed by _id, you can create a stored procedure that create a sequence and trigger for any new table , so you can save the time and effort by keeping database objects naming conventions )
4- Documentation of the database design is very important for understanding, updating , and maintaining the database design , this document should describe the details of the database design and its functionality and break down ERDs .
5- The development environment must have maintained Templates for any developed business unit ( form – report - process - menue , ... etc) by having templates with subclassing you can adjust the code of specified triggers ( subclassed one ) of 1000 form module for example in 1 menutes after compiling the 1000 if you use object classing , or only one minute without compiling if you call the code stored in pll library ,
also templates are very critical issue in the development process or the interface changing .
6- Commenting the code should include the name of author
, the date of creation, the date of adjustment, the reason,
simple description of the functionality of the code. ,and hints on every line important to know
7- Testing Procedures must be set , starting with the unit test , transaction test to improve the quality of the product the process can be as the following :
- Test the business unit against (insert , update, delete, and query functions)
- Test the business unit against the required validation of the form or the report
- Test the functionality of the form or report against the functionality in the whole system cycle.
- Maintain more than one test scenario for the business unit .
8- Performance considerations must be taken to improve the quality of the product according to your frame work and your requirements , forexample
- Any SQL statement must be written on the database side not in the forms side to avoide the network traffic caused by the database roundtrips
- Any business unit must be developed from the designed template ( Form module from the from module template , report from the report template, parameter form from the parameter form template ,….. etc) to centeralize the performance tunning issues
- Packages Should be maintained and used in the Development process to get their benefits in performance and organizing the work
- Naming Conventions of the forms , reports ,PLL libraries , OLB libraries , Object groups , Program units , canvases, blocks, …. Etc must be maintained to easily develop and maintain (easy and fast )
- Any common Pl/sql code must be packaged in the PLL libraries to ensure that the right code is used for the issue arised
- Any common interface items packaging should be packaged in Object group (for example approval process , contact object group )
- Primary keys must be numbers only and auto filled not user filled other unique columns like code can have unique constraint and can maintained by the user
- No composite primary keys are allowed
- Use the appropriate way to get block non related data ( Join – view – database function ) according to the situation rather than using the post – query trigger
- Any in ordinary way of coding must be discussed between team member before using it in the development process ( discussion among the team member is very important and very usefull process )
- Any object group, templates, Should be documented and has its read me file to guide the developer how to use it in the development process.
- The basic triggers of the form or the report mustn’t be used by the developer ( instead write the code in the called procedures in the original triggers for example design your when-new-form-instance to call the following procedure - p_before_init ;
Fram_work_code;
p_after_init ;
p_before_init ; is module program unit that the user can write his code when he want to execute his own code in the when new form instance trigger , and so on .....
- Messaging to the end user must be done through defined package in the system to facilitate any future modification or enhancements ( like multilingual messaging)
- Any interface item ( text item , display item , list item , Button , ….. etc) must be sub classed from the appropriate object ( smart class shoul be maintained to easily do this process)
- Any tabular Block should have indicator item to improve the interface looking and current record visual attribute
- Any huge number of columns to be displayed on the form should be set its canvas to stack canvas style to expand horizontally.
9- “ Know How “ documentation must be maintained to facilitate the work process and exchange the experience between team members
10- The implementation of the work to the production Environment must have documented procedures and flow chart ( this is very important issue )
11- Documentation of how to develop Form Module, how to develop Report module, how to develop parameter form Must be read before any development starts for the first time , to avoid the violation of develompment standrds
Read Client machine Information ( Get benefit of using the java beans in Forms)

Using java beans in your forms is very usefull action to increase your application performance , functionality , and interface attraction .
fore example
1- a java bean that restrict the input of text item to number will decrease network traffic if the user enter character.
2- a java bean that customize the shape of forms buttons will make your interface more attractive
3- a java bean that read client machine information , increase your forms functinality
in this post we will explain a java bean that can read client machine information ( webutil can do this also ) and pass it to the form
- consider that you want to know which Ip address currenty use this form
first step is to make the deployment steps of using java bean
1- pur the jar file in your java path
2- edit Archive_jinit parameter in your formsweb.cfg in your section to add this jar name
3- create a bean area in your forms
4- set the implementation class property of your bean item to
oracle.forms.fd.ClientInfos ( case sensitive)
5- write your code to get the information you want as follow :
- to get the Ip address and pass it to bind variable
:your bind variable:= Get_Custom_Property('your bean item', 1, 'IP' ) ;
- to get the operating system
:your bind variable : =get_custom_property('your bean item',1,'operating');
- to get the operating system user name
:your bind variable : =get_custome_property('your bean item',1,'username');
very important note :
-- if you want to get this information in "when new form instance "
you have to write your code in " when timer expired " to ensure that the form interface included the bean area is built
you can download the jar file from http://sheikyerbouti.developpez.com/forms-pjc-bean/menu/