Friday, March 22, 2019

Concurrent Program Report to RTF query

SELECT fcpv.user_concurrent_program_name "USER PROG NAME",
                fcpv.concurrent_program_name "PROG NAME",
                fcpv.concurrent_program_id "PROGRAM ID",
                fcpv.creation_date "PROG CREATION DATE",
                fcpv.created_by "PROG CREATED BY",
                xddv.application_short_name "DD APP SHORT NAME",
                xddv.data_source_name,
                xtv.application_short_name "DT APP SHORT NAME",
                xtv.template_code,
                xtv.template_name,
                fe.executable_name,
                fe.execution_method_code,
                fe.execution_file_name ,
                xl.file_name,
                fcpv.enabled_flag, xl.last_update_date
  FROM  apps.fnd_concurrent_programs_vl fcpv,
               apps.fnd_executables fe,
               apps.xdo_ds_definitions_vl xddv,
               apps.xdo_templates_vl xtv,
               apps.xdo_lobs xl
 WHERE xddv.data_source_code = xtv.data_source_code
 AND      xddv.data_source_code = fcpv.concurrent_program_name
 AND fe.executable_id  = fcpv.executable_id
 AND   UPPER(template_name) like '%PACK%'
 AND   fcpv.enabled_flag = 'Y'
 AND fe.execution_method_code = 'P'
 AND  xl.lob_type in ('TEMPLATE','TEMPLATE_SOURCE')
AND    lower(xl.file_name) like '%.rtf'
AND  xtv.template_code=xl.lob_code

Monday, March 18, 2019

Add KFF /DFF to forms

Source1
Source 2



DB TEXT item should be hidden - canvas null

Create a dummy TEXT item for the KFF display
Non DB item
LOV 'ENABLE_LIST_LAMP' with "valiate from list" as no

WHEN-NEW-FORM-INSTANCE trigger.
Initialize KFF using fnd_key_flex.define(

       select  to_char(id_flex_num)
        from    fnd_id_flex_structures
        where   id_flex_structure_code = 'ACCOUNTING_FLEXFIELD'
                and id_flex_code = 'GL#';


 Then, all that is left to do is to program a few events:

WHEN-VALIDATE-ITEM
WHEN-NEW-ITEM-INSTANCE
POST-QUERY
PRE-QUERY
KEY-LISTVAL



We always try to put this code in the form level triggers
as it is more convenient and consistent than doing it at block or item level,
especially when you have more than one foreign key flexfield in the form.
Only in the case of very large and complicated forms would we do otherwise.

 WHEN-VALIDATE-ITEM

    if ( :system.mode = 'NORMAL' ) then

       fnd_flex.event( 'WHEN-VALIDATE-ITEM' );

    end if;

WHEN-NEW-ITEM-INSTANCE

    app_standard.event('WHEN-NEW-ITEM-INSTANCE');

    fnd_flex.event('WHEN-NEW-ITEM-INSTANCE' );

POST-QUERY

--Loads the flexfields (in our case, it populates

--the concatenated field on execute query).

    FND_FLEX.EVENT('POST-QUERY');

PRE-QUERY

--If you don't do this, whatever query criteria you may enter in

-- the concatenated flex field, it is not taken into account.

    FND_FLEX.EVENT('PRE-QUERY' );

KEY-LISTVAL

    APP_STANDARD.EVENT('KEY-LISTVAL');

    FND_FLEX.EVENT('KEY-LISTVAL' );