Attachment FNC
Attachment FNC
html
Attachments are enabled at Sales order level. It is desired to display & pull same attachments in the
custom form based on the sales order selected.
Solution
Contact your technical expert to write a small piece of code to enable attachments icon in your
custom form first. It is some kind of initialization that one needs to do.
Navigate to Application Developer->Attachments->Attachment Functions
You can setup attachment at Form level or Function level. Unless you have a complex requirement,
you can safely go ahead with "Form Level"
Search for your form with following parameters Type=Form, User Name = "Form Name"
Setup Blocks
Click on blocks button
Enter block name. E.g. "SO_HDR_VIEW" is the block name which displays "Sales Order Headers"
in the custom form
Select method as "Query Only" or "Allow Change", depending on whether you want the users to
modify the attachments or not. Since, the current requirement is to just display the attachments, I
choose "Query Only"
Secured By can be Organization/Set of Books or Business Unit. I need no security, so I choose
"None"
Click on Entities button. Entity is nothing but the subject or level to which documents are attached
and stored. So, in case attachments are defined for sales orders then, entity would be the base table
name of sales orders OE_ORDER_HEADERS_ALL.
Since, in this case attachments are already defined for Sales orders, there is no need to define a
new entity. I can as well choose an existing entity "OM Order Header"
Display method-Choose Main Entity, if you want to display it as soon as "Attachment Icon" is clicked.
Once you select Block Method as "Query Only". You can possibly select only above values in the
privileges section
Go to Primary Key Fields and select the primary key from your custom form. In this case, I must
have "HEADER_ID" as part of my SO_HDR_VIEW block in the custom form. Syntax:
Save and you are done with setting up Blocks.
Setup Categories
Go back to first form and click on "Categories"
Select a document category which is attached to the standard sales order form. You can as well
create a new attachment category. Note that the attachment category is just a logical classification of
the documents. Every document is linked to a category. Once you assign a category. You can then
attach any documents of the attached categories to your custom form.
In this case, I select an category which is already attached to my Sales order form
Save. Now you can safely navigate to your custom form. Go to "SO_HDR_VIEW" block. Select the
sales order and click on "Attachments Icon". You should be able to see the attachments.