Monday 8 January 2018

Creating DFF in a Custom Form

1. Go to Application Developer -> Flex Fields -> Descriptive -> Register
Enter all the details and click on Columns.
Enable the columns and save.
2. Now go to Segments menu.
Search for the created DFF.
Select the Global Data Elements and click on Segments.
Create the new segments and save
3. Now the DFF is ready to use in the Form builder.
4. Create a Text Item
   SubClass Information : TEXT_ITEM_DESC_FLEX
   LOV : ENABLE_LIST_LAMP
   Validate from List : No
   Database Item : No
5. Now create a package in Program Units section as

PACKAGE BODY <package> IS
 procedure <procedure>(Event in varchar2) is
 BEGIN
IF EVENT = 'WHEN-NEW-FORM-INSTANCE' THEN
FND_DESCR_FLEX.DEFINE(BLOCK => <Data Block Name>,
     FIELD => <DFF Field Name>,
     APPL_SHORT_NAME => 'SQLAP',
     DESC_FLEX_NAME => <DFF Name registered in the Application> );
  END IF;
 END;
END;
6. Create below triggers:
WHEN-NEW-FORM-INSTANCE - > package.procedure('WHEN-NEW-FORM-INSTANCE');
WHEN-NEW-ITEM-INSTANCE -> FND_FLEX.EVENT('WHEN-NEW-ITEM-INSTANCE');

Oracle apps provides the API named, FND_FLEX, for Descriptive flexfield events. You can to write all the block level triggers to have consistent normal behaviour of the descriptive flexfield.

WHEN-VALIDATE-ITEM ->  FND_FLEX.EVENT(‘WHEN-VALIDATE-ITEM ‘);
PRE-QUERY ->  FND_FLEX.EVENT(‘PRE-QUERY’);
POST-QUERY ->  FND_FLEX.EVENT(‘POST-QUERY’);
WHEN-VALIDATE-ITEM ->  FND_FLEX.EVENT(‘WHEN-VALIDATE-RECORD’);
PRE-INSERT ->  FND_FLEX.EVENT(‘PRE-INSERT’);
PRE-UPDATE ->  FND_FLEX.EVENT(‘PRE-UPDATE’);

No comments:

Post a Comment