In a previous article we have discussed how a custom DFF is registered in Oracle Apps. In this article I have demonstrated the process to add the DFF to a custom form.
Step 1: Create the custom table
We have created a custom table with the following script,
CREATE TABLE xx_supplier_blacklist ( blacklist_id NUMBER NOT NULL PRIMARY KEY, supp_number VARCHAR2(30), supp_name VARCHAR2(240), address VARCHAR2(1000), LOCATION VARCHAR2(2), supp_lob VARCHAR2(240), blklist_flag VARCHAR2(3), reason_blklist VARCHAR2(240), reason_details VARCHAR2(1000), date_blklist DATE, date_remove DATE, reason_blk_remove VARCHAR2(240), detail_reason_remove VARCHAR2(1000), linkage VARCHAR2(3) , attribute_category VARCHAR2(150), attribute1 VARCHAR2(240), attribute2 VARCHAR2(240), attribute3 VARCHAR2(240), attribute4 VARCHAR2(240), attribute5 VARCHAR2(240) ) /
We will use the attribute columns as our DFF segments
Step 2: Register the custom table
We need to register the custom table in Oracle since we need to add the attributes, attribute1..attribute5 as DFF.
You can refer to this article for registering the table. Once the table is registered you can check it on the front end.
Step 3: Register the DFF
You will find the registration steps in this article
The registered DFF will be this,
Click on Segments
Step 4: Configure Forms Builder
Forms builder has to be configured for developing Oracle Apps forms. You can find the steps in this article.
Step 5: Develop the custom form for Oracle Apps
You can follow the steps to develop a custom for Oracle Apps in this article.
We have created a new block named, XX_SUPPLIER_BLACKLIST. Add a new field in the block for the DFF.
We have named the field, DFF.
The important properties to be set are,
Subclass Information: TEXT_ITEM_DESC_FLEX
Canvas: <Set the name of the Canvas manually since the item was created manually>
Database Item: No
Insert Allowed: Yes
Update Allowed: Yes
List of Values: ENABLE_LIST_LAMP
Validate From List: No
Notice the DFF text item on the canvas.
Now create a procedure in the form as given below,
PROCEDURE xx_supplier_blacklist_dff (event VARCHAR2) IS BEGIN IF (event = 'WHEN-NEW-FORM-INSTANCE') THEN fnd_descr_flex.define (BLOCK => 'XX_SUPPLIER_BLACKLIST', -- Name of the DFF FIELD => 'DFF', appl_short_name => 'CUSTOM', desc_flex_name => 'BLACKLIST_FLEX' ); ELSE NULL; END IF; END;
Now we need to add the call to this function when the form is initiated. Therefore we need to call the procedure from WHEN-NEW-FORM-INSTANCE. Open the WHEN-NEW-FORM-INSTANCE trigger.
Add the following line to call the inbuilt procedure,
Finally we need to raise the event to call the DFF when the DFF field is clicked on. This will ensure that the DFF segments will be displayed.
Create a trigger, WHEN-NEW-ITEM-INSTANCE, on the block item named, DFF, and add the following line,
Save the form and compile it on the server.
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 ‘);
You will find a new procedure in the Program Units section
The code in the procedure is,
PROCEDURE xx_supplier_blacklist_dff (event VARCHAR2)
IF (event = ‘WHEN-NEW-FORM-INSTANCE’)
fnd_descr_flex.define (BLOCK => ‘XX_SUPPLIER_BLACKLIST’, — Name of the DFF
FIELD => ‘DFF’, — Field name
appl_short_name => ‘XXCUST’, — Custom Applications
desc_flex_name => ‘BLACKLIST_FLEX’
This procedure has been generated by Oracle for invoking the flex field window and its functionality.
Step 6: Register the form
Now we need to register the form in Oracle Applications
Responsibility: Application Developer
Navigation: Application > Form
Enter the form details
Application: Custom Applications
User Form Name: Supplier Blacklist form
Description: Supplier Blacklist form
Register the form function
Navigation: Application > Function
Enter the following:
User Function Name: Supplier Blacklist Func
Description: Supplier Blacklist function
Form: Supplier Blacklist form
Save and close the form. Now the form is registered.
Step 7: Attach the form function to a menu/responsibility
After the form and the form functions are created we need to attach the form function to a menu that is attached to a responsibility. Once this is done the form will be accessible to us from that responsibility and other responsibilities which use that menu.
We would like to access the form from the responsibility named, IN AP Manager (HO). Let us open the responsibility form.
Responsibility: System Administrator
Navigation: Security > Responsibility > Define
Query for responsibility, IN AP Manager (HO).
Note the Menu name. It is AP_NAVIGATE_GUI12.
Navigate to Application > Menu.
Query for User Menu Name = AP_NAVIGATE_GUI12.
Scroll down to the bottom of the lines and add a line.
Function: Supplier Blacklist Func
Description: Supplier Blacklist Function
Save and close the form. You will get a popup message saying that the menu us being recompiled. Now the form function is attached to the menu and will be accessible to us from the responsibility.
Test the form
Log in to Oracle and go to the responsibility, IN AP Manager (HO) as we had attached the form to the menu of this responsibility (Step 7).
Note the function, Blacklist, at the bottom of the navigation menu. Click on this function.
The form opens up. Now click on the DFF field on the bottom right.
Now the DFF form has also opened. Let us enter some values in the form as shown below.
Save the form. Query the data from the table and let us see if the data has been entered properly into the attribute columns. In this case we have setup only ATTRIBUTE1 as the DFF segment (Step 2).
Run the following query,
select blacklist_id, supp_number, supp_name, attribute_category, attribute1 from xx_supplier_blacklist
We can see that the DFF value has been entered properly into the table. The form is now enabled to use the DFF segment(s). You can make as many changes on the DFF segments and it will reflect on the form just like any Oracle seeded form.
- How to enforce a user to enter a comment when he rejects a workflow notification (oraclemaniac.com)
- Dynamically wrap PLSQL code (oraclemaniac.com)
- GL Funds check functionality (oraclemaniac.com)
- Notifications from Workflow Business Events (oraclemaniac.com)
- How to migrate personalization on OAF pages (oraclemaniac.com)
- Create and register a custom Descriptive Flexfield (DFF) (oraclemaniac.com)
- Configure Forms Builder 6i and 10g to develop Oracle Apps forms (oraclemaniac.com)
- How to invoke Flexfield form to enter GL accounts as parameters in a report (oraclemaniac.com)