Thursday, December 11, 2008

Steps for enabling folder functionality for Custom Form

Steps for enabling folder functionality for Custom Form:

(1)Add the library APPFLDR.pll to the form. It is found in AU_TOP/resource

(2)Add the STANDARD_FOLDER object group to the form by copying it from APPSTAND.fmb

(3)Create a parameter ex: blockname_par of type number with initial value=2

(4)Create two canvases one of type stacked (ex: blockname_stacked) and the other of type content (ex: blockname_content). Display the fields in the main data block in the stacked canvas.
Display the two canvases in the same window (ex: blockname_window)

(5) Create the following 9 Triggers at Main Data Block Level


(ii)KEY-PREV-ITEM if (:parameter.blockname_par = 1) then previous_item; else app_folder.event('KEY-PREV-ITEM'); end if;
(iii)KEY-NEXT-ITEM if (:parameter.blockname_par = 1) then next_item; else app_folder.event('KEY-NEXT-ITEM'); end if;
(iv)PRE-BLOCK app_folder.event(‘PRE-BLOCK’);
(v)POST-BLOCK app_folder.event(‘POST-BLOCK’);
(vi)PRE-QUERY app_folder.event(‘PRE-QUERY’);
(vii)POST-QUERY app_folder.event(‘POST-QUERY’);
(viii)KEY-EXEQRY app_folder.event(‘KEY-EXEQRY’);
(ix)FOLDER-RETURN-ACTION 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;

(6) Create FOLDER_SWITCHCreate an item FOLDER_SWITCH on folder block (main data block) with subclass property ‘Switcher’.

(7)Create Prompt Block
Create prompt items for the items in the main data block with the same names and these prompt items must also be on the stacked canvas. All these items must have the following properties


(8)Add the following items to the prompt block
FOLDER_OPENItem Type: Push ButtonSubclass: FOLDER_OPENCanvas: Content CanvasFOLDER_DUMMYItem Type: Text ItemSubclass: FOLDER_DUMMYCanvas: TOOLBARFOLDER_TITLEItem Type: Display ItemSubclass: DYNAMIC_TITLECanvas: Content CanvasORDER_BY1Item type: Push ButtonSubclass: FOLDER_ORDERBYCanvas: Content CanvasORDER_BY2Item type: Push ButtonSubclass: FOLDER_ORDERBYCanvas: Content CanvasORDER_BY3Item type: Push ButtonSubclass: FOLDER_ORDERBYCanvas: Content Canvas
(9)Add the following form level triggers
FOLDER ACTION triggerapp_folder.event(:global.folder_action);


('XX_FORM', --- Form Name
'XX_DATA_BLOCK', --- Database block Name where folder function needs to be enabled
'XX_PROMPT', --- Block name which is going to control the Folder Block.
'MAIN_STACK_CANVAS', --- Stacked canvas name on which the database block resides 'MAIN_WINDOW', --- Window in which the Content/Stacked Canvas reside
NULL --- Disabled Fuction );

1 comment:

Android said...

Hi Sairam,
I have followed your steps and the form appears to be working with one exception. I have put some required items in the content canvas and the rest are in the stacked canvas. But during navigation, once the cursor is in stacked canvas, it does not move to the content canvas items even though the cursor moves to the next record. That means, the cursor moves to the next record without putting the cursor in the content canvas.

Could you help me out why the cursor does not navigate to the content canvas items?

Thanks in advance,