Translate

Wednesday, October 2, 2019

Enable folders Options custom forms in Oracle Apps r12


Here are the 9 steps to enable folders in custom forms.
These Changes will make sure that folder can be saved and its query criteria are also saved.
1. Pick up Template.fmb from your $AU_TOP/resource directory on server where forms are residing.
2. Check out all the libraries get loaded successfully along with the Template.
3. Check for APPDAYPK.pll loaded fine, else copy it from APPSTAND.fmb
4. Attach APPFLDR library/pll
APPFLDR can be found in $AU_TOP/Resource directory on server where forms are residing.
5. Copy the STANDARD_FOLDER Object Group
STANDARD_FOLDER Object group can be referenced from APPSTAND form which resides in $AU_TOP/Resource. This will also copies the dependent objects required for object group.
This will copy Folder Related Blocks,Canvases and other necessary objects.
6. Let us say we have One Main block, Not concerned with Control BlocksMain Block:
XXPH_RCPT_HIS then
Create <BLOCKNAME>_RECORD_COUNT parameter
as XXPH_RCPT_HIS_ RECORD_COUNT parameter
where BLOCKNAME is the name of the block containing columns to be displayed. Data Type should be Number and Put default Value of 2.
Canvas
You need two canvas- one content and one stacked. Let us name content canvas as XXPH_RCPT_HIS_CONTENT and stacked canvas as XXPH_RCPT_HIS_STACKED. Both the canvas have same window.
Windows
Create One Window. Name it XXPH_RCPT_HIS_WIN with view name as XXPH_RCPT_HIS_WIN
BlocksMain Block:
XXPH_RCPT_HIS contains database columns. Items should be on Stacked canvas (XXPH_RCPT_HIS_STACKED).
7. Create following eight triggers:
WHEN-NEW-BLOCK-INSTANCEapp_folder.event('WHEN-NEW-BLOCK-INSTANCE');
KEY-PREV-ITEMif (:parameter.XXPH_rcpt_his_record_count = 1) then
previous_item;
else
app_folder.event('KEY-PREV-ITEM');
end if;
KEY-NEXT-ITEMif (:parameter.xxph_rcpt_his_record_count = 1) then
next_item;
else
app_folder.event('KEY-NEXT-ITEM');
end if;
PRE-BLOCKapp_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');
8. PROMPT Block:
Create new block XXPH_RCPT_HIS_PROMPT: which will contain prompts for the column displayed in upper block.
Make subclass information as DYNAMIC_PROMPT.
This block should contain:
Items which will be Prompts for above block columns (Item name should be same as Column name in above block). Prompt Items should be on Stacked canvas (XXPH_RCPT_HIS_STACKED).
Create new Items specified below:
Item Name: FOLDER_OPEN, Item Type: Button, Canvas: XXPH_RCPT_HIS_CONTENT,Subclass:Dynamic_Title
Item Name: FOLDER_DUMMY, Item Type: Text Item , Canvas: TOOLBAR ,Subclass:Folder_Dummy
Item Name: FOLDER_TITLE, Item Type: Display Item, Canvas: XXPH_RCPT_HIS_CONTENT,Subclass:Dynamic_Title
Item Name: ORDER_BY1, Item Type: Button, Canvas: XXPH_RCPT_HIS_STACKED
Item Name: ORDER_BY2, Item Type: Button, Canvas: XXPH_RCPT_HIS_STACKED
Item Name: ORDER_BY3, Item Type: Button, Canvas: XXPH_RCPT_HIS_STACKED
Item Name:Folder_Switcher, Item Type:Text,Canvas: XXPH_RCPT_HIS_CONTENT,Subclass:SWITCHER
Check out your Both Canvases for setting these new buttons,prompts.
9. Form Level Triggers
FOLDER_ACTION--
-- Remove the message and uncomment the line after it to activate the folder actions
--
-- message('You must modify the FOLDER_ACTION trigger in your form!');
app_folder.event(:global.folder_action);
WHEN-NEW-FORM-INSTANCE
app_folder.define_folder_block(' XXPORCHUK ', -- 'Object Name'
' XXPH_RCPT_HIS ', -- 'folder_block',
' XXPH_RCPT_HIS_PROMPT ', -- 'prompt_block',
'XXPH_RCPT_HIS_STACKED', --'stacked_canvas',
'XXPH_RCPT_HIS_WIN', --'window',
NULL); --'disabled functions');




Create custom form with folder functionality Oracle forms



      1)      Open APPSTAND.fmb and copy STANDARD_FOLDER object group to the form.

      2)      Add the library APPFLDR.pll to the form.

      3)      Create a parameter of type number with initial value as 2. Parameter name should be    
               blockname_parameter. Create more blockname_parameters if the form has more folders.

Tip: Use Tabbed canvas Tab Pages to place/align the FIXED and STACKED canvases for visual appeal.


Canvas

        1)      Create a Primary content canvas for Window and 2 stacked canvas. 1 as NAME_FIXED and
            as NAME_STACKED. Set window to primary window.

a.       Set NAME_FIXED subclass as CANVAS_STACKED_FIXED_FIELD and add the primary fields from data block. (usually less than 4 non editable fields but can be many)

b.      Set NAME_STACKED subclass as CANVAS_STACKED and add all the needed fields from data block.

Block Level 

         1)      Set main data block item property Prompt to null which are used on canvas. Headings are  
                  used from prompt block mentioned below.
                            


              2)       Create FOLDER_SWITCH item on main data block with subclass property ‘Switcher’. 

                              


            3)      (Optional) CURRENT_RECORD_INDICATOR on main data block with subclass property
               CURRENT_RECORD_INDICATOR

                     
                          


         4)      Create the following 9 Triggers at Main Data Block Level  

              
    WHEN-NEW-BLOCK-INSTANCE
                 app_folder.event('WHEN-NEW-BLOCK-INSTANCE');
KEY-PREV-ITEM
               if (:parameter. blockname_parameter = 1) then
                     previous_item;
                    else
                          app_folder.event('KEY-PREV-ITEM');
                   end if;
KEY-NEXT-ITEM
               if (:parameter. blockname_parameter = 1) then
                     next_item;
                    else
                          app_folder.event('KEY-NEXT-ITEM');
                   end if;
PRE-BLOCK
           app_folder.event(‘PRE-BLOCK’);
KEY-EXEQRY
            app_folder.event(‘KEY-EXEQRY’);
POST-BLOCK
               app_folder.event(‘POST-BLOCK’);
PRE-QUERY
             app_folder.event(‘PRE-QUERY’);
POST-QUERY
             app_folder.event(‘POST-QUERY’); 


Create Prompt Block

Once the main data block item properties are set, copy items that are displayed on canvas and create a new prompt block. Don’t use FOLDER_SWITCHER and CURRENT_RECORD_INDICATOR items from main data block.

            1)      Set subclass of the prompt block to DYNAMIC_PROMPT.


2)      Set subclass of the item as below and assign items to appropriate canvas (Fixed/Stacked).

Item Type: Display Item

Subclass: FOLDER_PROMPT_MULTIROW

Initial Value: Prompt of the field name

 

            3)      Add the following items to the prompt block


Properties

FOLDER_OPEN

Item Type: Push Button

Subclass: FOLDER_OPEN

Canvas: Content Canvas / Tabbed canvas as per design

FOLDER_DUMMY

        Item Type: Text Item

Subclass: FOLDER_DUMMY

Canvas: TOOLBAR

FOLDER_TITLE

Item Type: Display Item

Subclass: DYNAMIC_TITLE

Canvas: Content Canvas / Tabbed canvas as per design

ORDER_BY1

Item type: Push Button

Subclass: FOLDER_ORDERBY

Canvas: Content/Fixed/Stacked Canvas

ORDER_BY2

Item type: Push Button

Subclass: FOLDER_ORDERBY

Canvas: Content/Fixed/Stacked Canvas

ORDER_BY3

Item type: Push Button

Subclass: FOLDER_ORDERBY

Canvas: Content/Fixed/Stacked Canvas



Form level triggers

1)      WHEN-NEW-FORM-INSTANCE
               APP_FOLDER.DEFINE_FOLDER_BLOCK(

                                  object_name        => 'XXXX' --NAME OF WINDOW

                                , folder_block_name  => 'XXXX'  --'FOLDER_BLOCK'

                                , prompt_block_name  => 'XXXX'              --'PROMPT_BLOCK'

                                , folder_canvas_name => 'XXXX' --'STACKED_CANVAS'

                                , folder_window_name => 'XXXXX'         --'WINDOW'

                                , disabled_functions =>  null       -'UPPER, ENABLED, lower, disabled'

                                , tab_canvas_name    => 'XXXXX'  -- TAB CANVAS

                                , fixed_canvas_name  => 'XXXX' --'STACKED_CANVAS_FIXED ) ;
                        app_folder.event( 'INSTANTIATE' ) ;
show_view('XXXX') ; --'STACKED_CANVAS'

2)      FOLDER_ACTION
                        app_folder.event(:global.folder_action);

3)      FOLDER-RETURN-ACTION (OPTIONAL)

If (:global.folder_action ='CONFIRM-HIDE-FIELD') then

                If :global.folder_field in ('FIELD1','FIELD2',etc..) then

                                :global.folder_action_allowed := 'FALSE';

                End if;

End if;

4)      WHEN-WINDOW-RESIZED

                                If :system.event_window in ('PO_REQ_INTERFACE_ALL_WINDOW') then

                                                app_folder.event('WHEN-WINDOW-RESIZED');

                                End if;


Accounts Receivable-AR setups in Oracle EBS Functional Financials - Apps R12

   1. Oracle Receivables -> Setup -> System ->System Options     a. Receivable GL related setup    b. Transaction and Customer rela...