Friday, October 28, 2016

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;


9 comments:

  1. I have just read your site Your blog is so interesting, Thanks for Share These valuable information.Our on-line coaching supplier gained the high commonplace name through worldwide for its teaching.
    Oracle fusion financials training

    ReplyDelete
  2. Hello,
    I have below code. Form is showing the message but does not stop from showing the field.

    if (:GLOBAL.folder_action in ('ADD–FIELD', 'SHOW-FIELD' )) then
    if :GLOBAL.folder_field IN ('TAX_ID') then
    :GLOBAL.folder_action_allowed := 'FALSE';
    fnd_message.debug ('You cannot view TAX-ID in this responsibility.');
    raise FORM_TRIGGER_FAILURE;
    else
    :GLOBAL.folder_action_allowed := 'TRUE';
    end if;
    end if;

    ReplyDelete
  3. Great Article, thank you for sharing this useful information!!

    CEH Training In Hyderbad

    ReplyDelete
  4. Amazon has a simple web services interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web.
    AWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    ReplyDelete
  5. great one,very interesting to read this one.awesome it is very useful thanks for sharing this article lie that we need more articles...............

    ReplyDelete
  6. That is nice article from you , this is informative stuff . Hope more articles from you . I also want to share some information about Best pet Clinic in Vizag

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. I appreciate this piece of useful information,Thank You. Aaraa couture

    ReplyDelete