Sunday, June 30, 2013

How to develop Folder Functionality In Forms

Folder Option for Custom Forms


How to Enable Folder Options for Custom Forms

Steps to Develop Folder Option

11)  Open the Template.fmb and remove the   “DetailBlock and BlockName” at Block level and    “Blockname” at canvas level “Blockname” at window level.

22)    Now you are going to develop the Form. Before that We need to attach the Library   “APPFLDR.pll”.


Click on yes and it will attached to the attached libraries.


Next Copy the STANDARD_FOLDER Object group from APPSTAND.fmb (Which resides in AU_TOP/Resource)

Click on Copy it will attach all the Default Properties.

Next create the window and canvas and blocks. While creating canvas u need to create one stacked canvas and one content canvas. Because the data block fields should be placed on Stacked canvas only and then stacked canvas should be placed on Content Canvas.
Create the window with these properties



Create the Content canvas
  

Create one stacked Canvas.


Next Create the Data Block . While Creating the Data block remove the Prompt for fields. Filed Prompt is no need. see this Below


Data block properties are as follows. U can increase the no of records displayed also.
 

Next Create The Prompt Block Manually. 

Next Copy all the items from your Main data block and paste it in the prompt block. After that change the properties for all the items.(Initial Value is Mandatory). The Name of the items in prompt block is same as in data block Items Name.

 

  
Next Create the Folder Switcher Item Manually along with these properties in main data block. That folder switcher should be first item of the Data block.

Item Name:Folder_Switcher, Item Type:Text_Item,Canvas: XX_CONTENT,Subclass:SWITCHER
  


Next Create the DRILL_DOWN_RECORD_INDICATOR in Main Data block.(i.e XXBLOCK)
   
  
Next create the items in Prompt Block Manually.

Item Name: FOLDER_OPEN, Item Type:Push Button, Canvas: XX_CONTENT,Subclass:Folder_Open
 

Item Name: FOLDER_DUMMY, Item Type: Text Item , Canvas: TOOLBAR ,Subclass:Folder_Dummy
 

Item Name: FOLDER_TITLE, Item Type: Display Item, Canvas: XX_CONTENT,Subclass:Dynamic_Title

Item Name: ORDER_BY1, Item Type: Push Button, Canvas: XX_STACKED1


Item Name: ORDER_BY2, Item Type: Button, Canvas: XX _STACKED1

Item Name: ORDER_BY3, Item Type: Button, Canvas: XX_STACKED1
 


Next Create one parameter

Next Create following eight triggers on main block
 

WHEN-NEW-BLOCK-INSTANCEapp_folder.event('WHEN-NEW-BLOCK-INSTANCE');

KEY-PREV-ITEM
if (:parameter.XX_BLOCK_RECORD_COUNT = 1) then
previous_item;
else
app_folder.event('KEY-PREV-ITEM');
end if;

KEY-NEXT-ITEM
if (:parameter.XX_BLOCK_RECORD_COUNT = 1) then
next_item;
else
app_folder.event('KEY-NEXT-ITEM');
end if;

PRE-BLOCK
app_folder.event('PRE-BLOCK');

POST-BLOCKapp_folder.event('POST-BLOCK');

PRE-QUERY
app_folder.event('PRE-QUERY');

KEY-EXEQRYapp_folder.event('KEY-EXEQRY');

POST-QUERYapp_folder.event('POST-QUERY');




Next in the When new form instance trigger write the following script :

app_folder.define_folder_block('XX_OHQ', -- 'Object Name'
'XX_BLOCK', -- 'folder_block',
'XX_BLOCK_PROMPT', -- 'prompt_block',
'XX_STACKED1', --'stacked_canvas',
'XX_ON_HAND_QUANTITY', --'window',
NULL); --'disabled functions');

app_folder.event('INSTANTIATE');



Then save the Form and compile and run the form. The out put of the form with folder options is look like this

 


 

How to Develop Query Find form

Steps To Develop a Query_Find Form in Oracle Apps
  • Step 1: Open Template.fmb with form builder save it with another name(XXMZ_Query_Find.fmb)  and give the module name as XXMZ_QUERY_FIND.
  • Step2 : Delete  BLOCKNAME from Window,Canvas and Data Block and delete DETAILBLOCK from Data Block.
  • Step 3: Create window(DEPT_WINDOW) apply subclass information as WINDOW and give the title.
  • Step 4:  Give this window name in PRE-FORM trigger (Form Level) and give this window   name in in APP_CUSTOM  body   Program_Unit( in place of window name).
Compile and Close The Window.
Compile and Close The Window.
 Step 5: Create Canvas(DEPT_CANVAS) apply subclass information as Canvas.
 Step 6:  Now Create Data block(DEPT)  with Wizard or Manual ,apply subclass information to the block as BLOCK   and also apply subclass information to the items as TEXT_ITEM.
 Step 7:Step 5: Drag QUERY_FIND Object Group from APPSTAND.fmb to Our Form(XXMZ_Query_Find.fmb) Object Group. Here we get  window,canvas,datablock will come automatically  with the name QUERY_FIND.
Step 8: Apply subclass information to Window,Canvas as well as Block. And drag these to first position   as shown in below.
 Step 9:  In QUERY_FIND data block we get 3 buttons(Clear,New,Find) with 3 Triggers.
Give Block name as DEPT in   WHEN-BUTTON-PRESSED trigger of New and Find Button. Compile and close.
Step 10: Next create  Control item in the Query_Find Block apply subclass information as TEXT_ITEM  and attach that item to the  QUERY_FIND canvas.
Step 9:
Next drag the QUERY_FIND trigger from APPSTAND.fmb and Place it in DEPT block  level trigger.
Syntax:             APP_FIND.QUERY_FIND(<results block window>,
<Find window>,
<Find window block>);
And write the following code in that trigger:
APP_FIND.QUERY_FIND(‘DEPT_WINDOW’, ‘QUERY_FIND’,'QUERY_FIND’);
 Step 10:
Next Create PRE-QUERY trigger in the block level(DEPT)
Syntax:          IF :parameter.G_query_find = TRUE THEN
COPY (<find Window field>,<results field>);
:parameter.G_query_find := FALSE;
END IF;
Write the following code
IF :parameter.G_query_find = ‘TRUE’ THEN
COPY(:QUERY_FIND.DEPTNO, ‘DEPT.DEPTNO’);
:parameter.G_query_find := ‘FALSE’;
END IF;
 Step 11: In the form module(XXMZ_Query_Find) give the first navigation block as QUERY_FIND. In the  QUERY_FIND datablock give next navigation block as DEPT.
 Step 12:   Finally Save and move your form from our Local Machine  to CUSTOM_TOP using WINSCP tool.
 Step 13:  Compile the Form using f60gen
In the UNIX environment, type the following command:
f60gen XXMZ_QUERY_FIND.fmb apps/apps
Now XXMZ_QUERY_FIND.fmx should be generated in the CUSTOM_TOP.
 Step 14:
Connect to Oracle Applications. Create a Form
(Navigation:Application Developer->Application-> Form)
Here give Form =>XXMZ_QUERY_FIND(.fmx )
Application => xxmz Custom(Custom TOP Application)
User Form Name=>Give any name
 Step 15: Create a function (Navigation: Application->function)
 Step 16:Attaching Form to the Function shown in below.
Attach that function to the Custom TOP menu
Click on Find Button