Skip to main content

Oracle Forms -- Enable folders for a particular resp IN A LOOKUP and also restrict by a partcular column

The Below code in WHEN-NEW-FORM-INSTANCE OR WHEN-NEW BLOCK-INSTANCE WHEN MULTIPLE BLOCKS HAVE FOLDER FUNCTIONALITY

atchmt_api.init('XWII_CUSTOMER_ITEM');
--Start of changes for View Setup Redesign project
DECLARE
lc_folder_title  VARCHAR2(1000);
BEGIN

:PARAMETER.RESP_NAME := fnd_profile.value('RESP_NAME');


--Check if the Resp is eligible to Create the Folder.:PARAMETER.CREATE_FOLDER will be used later to enable/disable create Folder.
DECLARE

--Create Folder eligibility
CURSOR lcu_create_folder (cp_resp_name IN VARCHAR2)
IS
  SELECT 'Y'
FROM   fnd_lookup_values flv
WHERE  flv.lookup_type = 'XWII_VS_CREATE_FOLDER_RESP'
AND    UPPER(flv.meaning) = UPPER(cp_resp_name)
AND    flv.enabled_flag = 'Y'
AND    NVL (flv.start_date_active,
  SYSDATE
- 1) < SYSDATE
AND    NVL (flv.end_date_active,
  SYSDATE
+ 1) > SYSDATE;

lc_create_folder_eligible  VARCHAR2(1);

BEGIN
 
:PARAMETER.CREATE_FOLDER := 'N';
OPEN lcu_create_folder (cp_resp_name => :PARAMETER.RESP_NAME);
FETCH lcu_create_folder
INTO :PARAMETER.CREATE_FOLDER;
CLOSE lcu_create_folder;

EXCEPTION
WHEN OTHERS THEN
NULL;

END;


app_folder.define_folder_block('XWII_CUSTOMER_ITEM'||:PARAMETER.RESOURCE_ID,
'SETUP_COILS',
'SETUP_COILS_PROMPT',
'SETUP_COILS',
       'VIEW_SETUP',
       'AUTOQUERY'
       );

--Get the Default Folder which created at Resource level and use it.
--If the user has a default folder, Oracle will use that Folder as default.
DECLARE
CURSOR lcu_dflt_folder (cp_object_name VARCHAR2)
IS
SELECT   folder_id
  FROM     fnd_default_folders
  WHERE    object = cp_object_name
  ORDER BY creation_date DESC;

ln_dflt_folder_id   NUMBER;
lc_object_name      VARCHAR2(500);
BEGIN

lc_object_name := 'XWII_CUSTOMER_ITEM'||:PARAMETER.RESOURCE_ID;

OPEN lcu_dflt_folder (cp_object_name => lc_object_name);
FETCH lcu_dflt_folder
INTO ln_dflt_folder_id;
CLOSE lcu_dflt_folder;

IF ln_dflt_folder_id IS NOT NULL
THEN
   APP_FOLDER.define(object_name => 'DEVELOPER_FOLDER_ID',
new_value   => ln_dflt_folder_id,
prompt      => null,
wdth        => null,
x_location  => null,
y_location  => null
);
END IF;

EXCEPTION
WHEN OTHERS THEN
  NULL;
END;

lc_folder_title := NULL;
IF :XWII_CUSTOMER_ITEM_PROMPT.FOLDER_TITLE IS NOT NULL
THEN
lc_folder_title := :XWII_CUSTOMER_ITEM_PROMPT.FOLDER_TITLE;
 
END IF;
 
  --Instantiate the Folders
  app_folder.event('INSTANTIATE');

--For some reason, when you jump between the forms, we are loosing the Fodler Title. Want to reinstate the Fodler Title if the Form is already open.

BEGIN
IF lc_folder_title IS NOT NULL AND
  :XWII_CUSTOMER_ITEM_PROMPT.FOLDER_TITLE IS NULL
THEN
:XWII_CUSTOMER_ITEM_PROMPT.FOLDER_TITLE := lc_folder_title;
END IF; --lc_fodler_title

EXCEPTION
WHEN OTHERS THEN
  NULL;
END;

EXCEPTION
WHEN OTHERS THEN
  NULL;
END;

IN WHEN-NEW-RECORD-INSTANCE DISABLE THE RESPONSIBILITY IF IT IS NOT DEFINE IN THE LOOKUP
IF NVL(:PARAMETER.CREATE_FOLDER,'N') = 'N'
THEN
   set_menu_item_property('FNDMENU.FOLDER',ENABLED,PROPERTY_FALSE);
   set_item_property('XWII_CUSTOMER_ITEM_PROMPT.FOLDER_OPEN',ENABLED,PROPERTY_FALSE);
END IF;

Comments

Popular posts from this blog

Xdoxslt XML Publisher RTF Important Syntax’s     1.        To convert CASE of a tag to UPPER case      xdoxslt:convert_case(.//MATERIALTYPE,'UPPER')     2.        To convert CASE of a tag to LOWER case      xdoxslt:convert_case(.//MATERIALTYPE,'UPPER')     3.        Syntax for CONTAIN      contains(xdoxslt:convert_case(.//MATERIALTYPE,'UPPER'),’IC CREDIT MEMO’)     4.        Syntax for NOT CONTAIN      not(contains(xdoxslt:convert_case(.//REFERENCE_ID,'UPPER'),'WSC'))     5.        CHOOSE-WHEN-OTHERWISE Syntax     <?choose:?><?when: contains(xdoxslt:convert_case(.//MATERIALTYPE,'UPPER'),’IC CREDIT       MEMO’)?><?’Interco Credit Memo’?><?end when?><?otherwis...

Oracle Forms -- Important Syntaxes

1. To get the enabled property of the item APP_ITEM_PROPERTY.GET_PROPERTY('CONTROL.FILTER_HOLD_RECORDS',ENABLED) 2. Disable Attachment for this Block in WHEN-NEW-BLOCK-INSTANCE  APP_SPECIAL.ENABLE('ATTACHMENTS', PROPERTY_OFF); 3. Default Where / Default Order By Set_block_property('XWII_MATL_DISP_HOLDS_V', Default_where, Lc_query); Set_block_property('XWII_MATL_DISP_HOLDS_V', order_by, Lc_query); 4. Visual Attribute    a. Define Visual Attribute for eg 'XWII' where you can set Colour  b. SET_ITEM_INSTANCE_PROPERTY('block.item_name',CURRENT_RECORD,VISUAL_ATTRIBUTE ,'XWII'); 4. Visual Attribute for Record APP_RECORD.HIGHLIGHT('XWII'); Where 'XWII' is the visual attribute where you can set Colour. 5. Initiliaze SPECIAL Menu app_special.instantiate ('SPECIAL1', GET_GROUP_CHAR_CELL ('SPECIAL_MENU.SPECIAL_MENU_ITEM', 1), '', TRUE, ''); 6. execute_trigger('SPECIAL25...

Enable/disable a trace to a Concurrent Program - Oracle Apps Reports Trace

How do you enable/disable a trace to a Concurrent Program? 1. Connect to Oracle Applications 2. Navigate to System Administrator->Concurrent->Program->Define 3. Query the concurrent program on which you want to enable trace. 4. Check the enable trace check box bottom of the screen, Save it. 5. Ask the developer to submit the request, Once the request got submitted and completed normal. 6. Get the spid as select oracle_process_id from apps.fnd_concurrent_requests where request_id=456624. 7. You will get a spid like 12340. 8. Goto Udump and ls -ltr *12344*. 9 . You will get trace file