Enable attachment button for an Oracle
Apps form
Posted by Abhijit Ray ⋅ April 23, 2012 ⋅ 13 Comments
Filed Under attachment function, block declaration, document categories, document entity,
entity declaration
All Oracle forms are not enabled to accept attachments, by default. We can enable the forms so
that we can attach documents, URL, and also text as attachments for each record/transaction. I
have demonstrated how to setup this functionality for the User form in Oracle.
If we open the User form, prior to setup, we shall find the attachment button disabled.

Since we shall enable the form to accept attachment we shall get some information about the
form which is need for configuring attachments.
Click on Help > Diagnostics > Custom Code > Personalize. Note the Function Name
Close the Personalize form. Now we need to check the block and exact field names for
USER_ID and USER_NAME fields as these will be configured later.
Click on Help > Diagnostics > Examine
Change the field to USER_ID

Change the field to USER_NAME
We shall use USER_ID and USER_NAME fields later on. Close the form

Setup steps
Responsibility: Application Developer. All configurations will be done in this responsibility.
Step 1: Create document entity
Navigation: Attachment > Document Entities
Create a new record
Table: FND_USER
Entity ID: FND_USER
Entity Name: User
Prompt: User
Application: System Administration
Save and close form
Step 2: Create attachment function
Navigation: Attachment > Attachment Functions
Create a new record
Type: Function
Name: FND_FNDSCAUS (This is the function name as setup on the Functions form)
User Name: Users (This value is populated automatically by Oracle when the function name is
selected)
Enabled: Checked
Click on Categories button.
You can add as many categories you like. We shall add 2 categories, Web and Documents.

Close this window and go back to the mail form. Click on Blocks button.
Create a new record.
Block Name: User (We had picked this value from the form earlier)
Secured By: None
Context 1: USER.USER_NAME (BLOCK.FIELD_NAME from the User form)
Click on Entities button. Enter the values
1.
2.
3.
4.

Entity: User (from the LOV)
Display Method: Main Entity
Include in Indicator: Checked
Include in View: Unchecked

Privileges tab
Query: Always
Insert: Always
Update: Always
Delete: Always
Click on Primary Key Fields tab
Primary Key Fields tab
Enter Key 1 as USER.USER_ID. This is the primary key of the main block.
Save the and close the form.
Step 3: Add document category
Navigation: Attachment > Document Categories
Create a new record
Category: User
Default Datatype: File (It can be any option from the LOV. Add if you require it as this field can
be blank as well)
Save the form. Click on Assignments button.
The default Type is Function. Add the name of the function, i.e. Users (This is the User Name
of the function defined in Attachment Functions form).

Save and close the form
Test the functionality
Open the User form.

Now the attachment button is enabled. We shall attach a document for a user. Query for user
SA1.
Now click on the attachment icon on the menu. The attachment form opens. Check the values
available for Categories. We had enabled Web and Documents categories this form function. We
get to pick only these 2 values.
We shall select category, Web and choose Data Type as File

Click on Browse button and select a file.
Click on Open

Click on Submit
Now close this window and go back to the form

Click on Yes button. Check the Source tab

Save and close this window.
We can check the attached document in the database as well. Connect to the database and
execute the following query,
SELECT attached_document_id, document_id, seq_num, entity_name, pk1_value,

1category_id
2FROM fnd_attached_documents
3WHERE entity_name = 'FND_USER' AND pk1_value = (select user_id from fnd_user
where user_name = 'SA1')

The uploaded document is attached to the record by the user_id (pk1_value). The form will now
accept documents for all users on the user form.
Note: ENTITY_NAME field in the table FND_ATTACHED_DOCUMENTS has the same
value as the Entity ID entered on Attachment Entity form in Step 1.
Cheers!

Attach

  • 1.
    Enable attachment buttonfor an Oracle Apps form Posted by Abhijit Ray ⋅ April 23, 2012 ⋅ 13 Comments Filed Under attachment function, block declaration, document categories, document entity, entity declaration All Oracle forms are not enabled to accept attachments, by default. We can enable the forms so that we can attach documents, URL, and also text as attachments for each record/transaction. I have demonstrated how to setup this functionality for the User form in Oracle. If we open the User form, prior to setup, we shall find the attachment button disabled. Since we shall enable the form to accept attachment we shall get some information about the form which is need for configuring attachments. Click on Help > Diagnostics > Custom Code > Personalize. Note the Function Name
  • 2.
    Close the Personalizeform. Now we need to check the block and exact field names for USER_ID and USER_NAME fields as these will be configured later. Click on Help > Diagnostics > Examine Change the field to USER_ID Change the field to USER_NAME
  • 3.
    We shall useUSER_ID and USER_NAME fields later on. Close the form Setup steps Responsibility: Application Developer. All configurations will be done in this responsibility. Step 1: Create document entity Navigation: Attachment > Document Entities Create a new record Table: FND_USER Entity ID: FND_USER Entity Name: User Prompt: User Application: System Administration
  • 4.
    Save and closeform Step 2: Create attachment function Navigation: Attachment > Attachment Functions Create a new record Type: Function Name: FND_FNDSCAUS (This is the function name as setup on the Functions form) User Name: Users (This value is populated automatically by Oracle when the function name is selected) Enabled: Checked
  • 5.
    Click on Categoriesbutton. You can add as many categories you like. We shall add 2 categories, Web and Documents. Close this window and go back to the mail form. Click on Blocks button. Create a new record. Block Name: User (We had picked this value from the form earlier) Secured By: None Context 1: USER.USER_NAME (BLOCK.FIELD_NAME from the User form)
  • 6.
    Click on Entitiesbutton. Enter the values 1. 2. 3. 4. Entity: User (from the LOV) Display Method: Main Entity Include in Indicator: Checked Include in View: Unchecked Privileges tab Query: Always Insert: Always Update: Always Delete: Always
  • 7.
    Click on PrimaryKey Fields tab Primary Key Fields tab Enter Key 1 as USER.USER_ID. This is the primary key of the main block.
  • 8.
    Save the andclose the form. Step 3: Add document category Navigation: Attachment > Document Categories Create a new record Category: User Default Datatype: File (It can be any option from the LOV. Add if you require it as this field can be blank as well)
  • 9.
    Save the form.Click on Assignments button. The default Type is Function. Add the name of the function, i.e. Users (This is the User Name of the function defined in Attachment Functions form). Save and close the form
  • 10.
    Test the functionality Openthe User form. Now the attachment button is enabled. We shall attach a document for a user. Query for user SA1.
  • 11.
    Now click onthe attachment icon on the menu. The attachment form opens. Check the values available for Categories. We had enabled Web and Documents categories this form function. We get to pick only these 2 values.
  • 12.
    We shall selectcategory, Web and choose Data Type as File Click on Browse button and select a file.
  • 13.
  • 14.
    Now close thiswindow and go back to the form Click on Yes button. Check the Source tab Save and close this window.
  • 15.
    We can checkthe attached document in the database as well. Connect to the database and execute the following query, SELECT attached_document_id, document_id, seq_num, entity_name, pk1_value, 1category_id 2FROM fnd_attached_documents 3WHERE entity_name = 'FND_USER' AND pk1_value = (select user_id from fnd_user where user_name = 'SA1') The uploaded document is attached to the record by the user_id (pk1_value). The form will now accept documents for all users on the user form. Note: ENTITY_NAME field in the table FND_ATTACHED_DOCUMENTS has the same value as the Entity ID entered on Attachment Entity form in Step 1. Cheers!