Automatic Attachments in Order Management

An Oracle Whitepaper March 2009

Summary…………….…………………….…………….………….…………..…………..2 Concepts..…………….……………….….………………….….…………….….…………2 Setup and demo………………………….…………….……….………….….….…………4 Code and functionality changes…….….………………………..……..…….…….………12 Security issues……………………….……………………………………….….………...14 Operations with attachments…………..…………………………………….…………….14 Attachment across entities…………………………………………………………………14

This paper addresses the Automatic Attachments functionality in Order Management application, version 11.5.10 and release 12. Attachments feature in Order Management allows to: • Include attachments with orders and order lines • Include attachments with order returns and order return lines • Add free form text to the Sales Order Acknowledgement Report • Quote header and lines include attachments The attachment documents can be viewed in the following forms: Order Organizer, Sales Orders, Blanket Sales Agreement Organizer, Blanket Sales Agreement, Quick Sales Orders, Quick Order Organizer, Quote, and Quick Quote windows.

The attachments feature enables users to link unstructured data, such as images, word processing documents, spreadsheets, or text to their application data.

A document associated with an entity is called an attachment.

Attachment function
A form or form function in your application cannot use attachments until the attachments feature is set up for that form or function; that is, it must be defined as an ”attachment function” in the Attachment Functions window.

A document is any object that provides information to support another object or action. Examples include images, word processing documents, spreadsheets, or text.

Document Category
A document category is a label that users apply to individual attachments and documents. Document categories provide security by restricting the documents that can be viewed or added via a specific form or form function. When you set up the attachments feature, you assign document categories to particular forms or form functions. When a user defines a document, the user assigns a category to the document. The attachments form can query only those documents that are assigned to a 2

the document is not updateable.fmb ) only allows you to create Template and Standard types and not One-Time documents. When you select a Standard usage document in the Document Catalog. If you delete an attachment that has a usage type of Template. As a result.set the profile option: OM: Apply Automatic Attachments to Yes . In the context of attachments. only the association of the document to the record is deleted. the document content. Document Usage Type Indicates how the document may be used. A base entity is the main entity of the block. an entity can be considered either a base entity or a related entity. Enable the profile OM: Apply Automatic Attachments.category to which the calling form or form function is associated. an order. The attachments feature must be enabled for an entity before users can link attachments to the entity. The copy is also updateable.the document is a standard document that can only be referenced. Setup and Demo Pre-requisites: In order to use Automatic Attachments in Order Management. When you select a Template usage document in the Document Catalog. or an order line. the document content is not deleted. Note: The Documents form ( FNDATDOC. such as an item. There are three usage types: Template . as well as the association of the document to the record is deleted.the document is meant to be modified/edited before use. If you delete an attachment that has a usage type of Standard. Documents that appear in the Document Catalog with a usage type of Standard. A related entity is an entity that is usually related to the block by a foreign–key relationship. it is necessary to: . Entity An entity is an object within Oracle Applications data. Documents that appear in the Document Catalog with a usage type Template. See the Oracle Applications User's Guide for additional information. the document content. A ”Miscellaneous” category is seeded to provide easy visibility of a document across forms. are created from the Documents Window screen in Oracle Applications. One-time . The One-Time documents are created using the Attachment form (FNDATTACH. If you delete an attachment that has a usage type of One-time. as well as the association of the document to the record is deleted.the document is meant to be used only once.fmb). Standard .define attachment addition rules for the attachment document ( in Attachment Addition Rules window) Automatic attachments in six steps 1. See the Oracle Applications User's Guide for additional information. are created from the Documents Window screen in Oracle Applications. at user level 3 . a copy of the document is created and the document usage of the copy is set to One-Time. a copy of the document is not made.

or other types of files. . 4. upload it in a file. 2. File or Web page). 3. Report or Function Define a document of type Standard or Template in the Documents form Create Attachment Addition Rules Create a Sales Order and check if the attachment document is applied automatically Demonstration 1. When File type documents are attached. File documents are external files such as Microsoft Word files. 6. Define a document category if you haven’t already defined one and choose a default data type (Figure 1).Launch the Upload a File window in your browser. or enter the file location in the File field.2.JPG files. If the text you want to attach is more than 2000 characters. Set the profile OM: Apply Automatic Attachments (OE_APPLY_AUTOMATIC_ATCHMT) to Yes. The default Datatype can be overridden when you create documents.Text – (short text or long text)Enter text that is less than 2000 characters. they are loaded into the database in the location set be the profile option Attachment File Directory (ATTACHMENT_FILE_DIRECTORY). Microsoft Excel files. Short Text. 5. . When a 4 . Define a document category Assign document category to various entities types: Form. Go to Order Management > Setup > Orders >Attachments > Document Categories Figure 1 – Defining Document Categories The Category defines the purpose of an attachment and controls which forms can access it. Select the Browse button to locate the file in your file system. Select the Default Data Type from the list of values (Long Text. image files such as .File .

the lower half of the Attachments window displays an ”Open Document” button that invokes a web browser and passes the URL to the browser. 5 .Web Page .oracle.Web Page documents are attached as URLs in the format http://www. The web browser handles displaying the file as appropriate based on its filename extension. Enter the URL for the Web page. The documents having Data Type: File cannot be saved as Template because they cannot be edited. enter an effective date range for your attachment When a user selects a Web Page document to view. the lower half of the Attachments window displays an ”Open Document” button that invokes a web browser and passes the file to the if your browsers can use that format). Optionally. Save the (or the format www. Figure 2 –Defining Documents having data type as File . Your cursor advances to the File or URL field on the Source tab of the window.File document is selected.

you can specify your own as well as Order Management’s default reports in this field. order-level attachments print only at the order header or order footer within the output. Additionally. Figure 4 – Assigning Document Category Order Management enables Oracle Application Attachment functionality for the following entities: • The Sales Order and Order Organizer Window (form) • The Sales Order Acknowledgement Report If you choose to include an Attachment for printing on the Sales Order Acknowledgement Report.Figure 3 – Defining Documents having data type as Web Page 3. You can associate as many reports as you need with a single category. you are currently limited to selecting a data type of Short or Long Text. 6 . Report or Function using the Assignments button (Figure 4). If you customize your own reports to include documents. Only text documents can print on reports. Assign document category to various entities types: Form. and order line-level attachments print only in the report body (within the body of each record displayed).

For entity type: Report. define a document of type Standard or Template in the Documents form. standard reports support only the seeded format of Header. You can add your own formats for selection within the CategoryAssignment window by adding values to the Order Management QuickCode NOTE_FORMAT type. and Footer. order-level notes print only at the header and footer levels. The Format value determines where documents in this category will appear on the report. 4. Body or Footer. Commercial Invoice. there is no longer the 'One Time' radio button on Usage region in the Attachments form.Oracle Shipping Execution enables Oracle Application Attachment functionality for entities such as: Bill of Lading. Oracle Pricing enables Oracle Application Attachment functionality for entities such as Agreements and Price Lists. Body. However. Also. and Pick Slip. Create Attachment Addition Rules The Addition Rules button opens the Attachment Addition Rules window (Figure 6).H Rollup 4 (RUP4) patchset : 4676589 and with Release 12. In standard reports. Figure 5 – Defining a document having Data Type as Long text Starting with Oracle Applications Technology 11i. line-level notes print only in the report body. Pack Slip. 5. 7 . select a Format: Header. Go to Order Management > Setup > Orders >Attachments > Documents Attach the document to the document category previously defined (Figure 5).ATG_PF.

For Order Management. Returns > Sales Orders form) 8 . you can specify your attachment addition rules by specifying values for the following attributes on the order. 6. attachment addition rules can be defined at the header level for the following attributes for orders.Figure 6 – Creating an Attachment Addition Rule for the new created Document These rules are used for automatically attaching of all types of documents to order headers and order lines. quote line. order line. When creating a Sales Order having an entity matching with the rule attribute defined in the addition rule defined previously. quotes. or return line: • Customer • Inventory Item • Invoice To • Line Category • Line Type • Purchase Order • Ship To Note: Blanket Sales Agreement does not support rule-based attachments. (Order Management > Order. or returns: • Customer • Customer PO • Invoice To • Order Category • Order Type • Ship To At the order line level. the attachment is applied automatically (Figure 7).

The Attachments icon invokes the Attachments window. the Attachment window is opened and the text is displayed. Figure 8 – Viewing the attchment document 9 . the icon appears as a paperclip holding paper (Figure 8). the paper clip icon will only be highlighted in the "Lines TAB" of the Order Organizer form. If attachments already exist. for line level attachments. Note: In Order Organizer.Figure 7 – Creating a new Sales Order elligible for automatic attachment When accessing Attachments icon. The paper clip icon in the "Summary TAB" of the Order Organizer form will only be highlighted when there are header level attachments.

The user will be asked to Save changes when leaving the attachments form. . Usage Type: The button is only enabled if the Usage Type of the current row is onetime. the "Publish to Catalog" button opens a dialog window. When choosing Standard or Template. The button is also secured by Function Security. the button is disabled. The "Publish to Catalog" button is conditionally enabled. 10 .test() to test if the function has been granted to the current user . or Cancel (Figure 9). a new attachment row must first be saved to the database. to allow it to be globally disabled. In FNDATTCH (Attachment) window. the system allows that this document to be published as Template or Standard document. with a specified text : “see also attached documents” when accessing Publish to Catalog. Cancel would do nothing and close the dialog. the button will not be displayed. OFO). If the user picks Standard then the current record will simply be changed to Standard and this will of course be published to the catalog by default. data published to catalog will be committed or rolled back along with the rest of the transaction. the dialog will pop up with 2 buttons: and ask “Would you like to publish as a Standard?”.A "Publish to Catalog" button has been added to the Attachments form. the current record is marked as Changed in Forms. Function Security: The Publish to Catalog button is controlled by function security. If the user picks Publish then the current record will simply be changed to standard and this will of course be published to the catalog by default. if adding a one time document: Sequence: 20. URL. System Administrators can delete or alter this grant if they want to restrict access. The new document saved as Template or Standard can be viewed using Document Catalog button and querying after Category and Usage fields. the function will be seeded as granted to GLOBAL user. • Row Status: The button is only enabled for queried rows.For Long Text and Short Text. based on the current row status and usage type (one-time. The option Cancel would do nothing and close the dialog. Category: MS_INVOICE. to allow one-time attachments to be easily published to the catalog as either Standard or Template documents. Before publishing to the catalog.if not. the dialog will ask “Which kind of document would you like this published as?”. etc). If a One-time document is of any other type (File. The Attachments form will call fnd_function. By default. not for new rows. • • Publish to Catalog Button Behavior . Creating a One-time document This can be done using the Attachments window (Figure 10). The options available in this window will vary based on Document type. Choices are Standard. If the user picks Template then a copy of the current record is made and set as a template and will thus show up in the Catalog. The function is named FND_FNDATTCH_PUBTOCAT of type SUBFUNCTION. Choices are 'Publish' or 'Cancel'.When pressed. Template. standard. Standard documents are already published to the catalog.

For attachment documents with Template as usage type the ‘May be changed’ check box is always enabled. The Standard and Template documents can be queried using Document Catalog window (Figure 11).Figure 9 – Creating a one-time document in Attachment window Figure 10 – Saving the one-time document as template in Attachment window The 'May Be Changed' checkbox is always disabled for documents having Usage Type as Standard and users will not be able to update the attachment. 11 .

the document can be previewed using Preview button (Figure 12): Figure 12 – Viewing the documents with Preview button in Document Catalog window Code and functionality changes 1. All template and standard documents can be controlled and maintained in the Documents form (FNDATDOC).Figure 11 – Querying the Template documents from Document Catalog window Also. and save the document to the catalog as a template or standard document so that it can be used again from the catalog. It was determined that onetime documents were never meant to show up in the catalog and this was causing many problems with maintaining and using documents. There was a change in ATG.RUP4: 4676589 and release 12. 12 . This is the way the documents were meant to be used in the Oracle Application. select it. The fix for bug 4566172 has obsoleted the one-time functionality and introduced the following changes: The application now has a button (Publish To Catalog) on the Attachments (FNDATTCH) form that will allow the user to create an attachment/document.

3. the same document can be shared across many entities (orders or WIP jobs). created only by the user on the Attachments (FNDATTCH) form. The changes of this Patch in this area are as follows: It adds a "Publish To Catalog" button on the FNDATTCH form (Attachments Form). The attachment record will need to be committed before the "Publish To Catalog" button would be enabled (in view).resolves the issue of display of one-time document with template region greyed out in FNDATDOC form (Documents form) for the new records. where they had no choice before. 2. You also will have the Publish to Catalog button controlled by function security. The FND patch 6843372 . When a template is selected and attached from the catalog it becomes a one-time. Because of the above fix when any attribute (with no addition rules defined) is changed. then also it was triggering attachments which has been partially fixed in bug 7449257. A template and standard document can be controlled and maintained whereas a one-time cannot. If you re-use a one-time document over and over it used to show up in the catalog for each time . Whenever reusing a document from the catalog it should be a template or a standard document.sometimes up to a thousand instances. This left room for error in picking one of the thousand documents that may look the same in the description field but were different in the content field. not one-time attachments. In order to correct the old records. datafix bug 7375991 is already logged for the same and provides a datafix for correcting the old records. Since bug 7449257 does not fix the complete issue (it is not feasible to fix it with current framework). A standard document also resides in the catalog and when is selected to be attached from the catalog.One-time documents were meant to be used only once (not re-used). Only change is that we're giving the end user control of whether their document is visible to everyone else. The Documents form only allows you to create Template and Standard types. with a dialog box containing buttons for "Standard" and "Template" that pops up after the "Publish To Catalog" button is pressed. Changed the FNDATDOC form (Documents form) so the Documents form only shows Template and Standard. a new Enhancement Request 7649341 has been raised with Develoment team 13 . The bug 6814730 fixed the attachment issue wherein change of attachment attribute was not deleting the attachment for old attribute value and attaching the attachment for new attribute value.

Attachments across entities In many cases. you should be able to specify who has the ability to apply and update the attachment and who can only view the attachment. the document content. Update an attachment You can update an attachments of type: One-Time and Templates. 2. insert or delete attachments. Users cannot create. In Copy window. update or delete the attachments if accessing the form via this function. Sales Order form (OEXOEORD): from any function other than the above query_only function that accesses the sales order form.Security issues with Attachments in Order Management When viewing the sales order and returns. the document content is not deleted. Operations with attachments Copy an attachment You can copy an attachment when using copy sales order functions. For Order Management. two attachment functions will be seeded: 1. If you delete an attachment that has a usage type of Standard. the tabs Copy Headers and Copy Lines. When a Template is attached and modified in the Attachments form the template itself is not updated instead another document is created with usage type = One-Time and that document is attached to the entity. we will address the requirement that attachment defined at Item Master level for a particular item to be visible on the Sales Order line level. the user will be able to query. update. The system administrator can thus restrict who can only view or who can view & edit attachments by setting up the associated menu to access the query_only function or any other sales order form function respectively. The attachment documents of type Standard cannot be updated. The setup mentioned below is needed to achieve this functionality: 14 . as well as the association of the document to the record is deleted. Query_only sales order form function (ONT_OEXOEORD_VW): the attachment function will be setup such that only viewing of attachments is allowed. In the example below. there is a checkbox Attachments that allows you to specify if you want to copy attachments from the source sales order. Delete an attachment If you delete an attachment that has a usage type of Template or One-Time. only the association of the document to the record is deleted. there is a need to have the attachment from one form visible on another form. This will be setup via Attachment Functions.

query for "INVIDITM" which is the fmb file name for "Master Item" form (Figure 14). 2) In the field Name.ORGANIZATION_ID Key 2: MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID Figure 14 – Block Declaration window for INVIDITM 15 . The primary key values should be: Key 1: MTL_SYSTEM_ITEMS.1) Under Application Developer responsibility > Attachments> Attachment Functions (Figure 13). Figure 13 – Attachment Functions form 3) Go to (B) Blocks-> then go to (B) Entities-> Entity "Item" -> Primary Key fields (Figure 15).

16 . 5) Select name as OEXOEORD. Figure 16 – Attachment Functions for OEXOEORD 7) Select block name 'LINE'.Figure 15 – Entity Declaration form and Primary Key Fields tab 4) Go to attachment function again. 6) Click on Blocks button (Figure 16). which is the fmb file name for 'Sales Orders' form.

11) In the Primary Key Fields tab put the following values (Figure 19): Key1 field: LINE. 9) Add a new entity 'Item' having Display Method as 'Main Entity'.INVENTORY_ITEM_ID which is mapped with 17 .ORGANIZATION_ID of "Master Item" form. Figure 18 – Entity Declaration form with the Item entity defined and setup of Priviledges 10) In the Privileges tab make query as 'Always' and rest privileges as 'Never' (Figure 18).SHIP_FROM_ORG_ID which is mapped with MTL_SYSTEM_ITEMS. Key2 field: LINE.Figure 17 – Block Declaration form for OEXOEORD 8) Click on Entities button (Figure 17).

Figure 20 – Access Attachment icon in order to define an attachment for the selected item In the Attachment window.INVENTORY_ITEM_ID of "Master Item" form. In this case: Miscellaneous(Figure 21) Figure 21 – Create an attachment for the selected item 18 .MTL_SYSTEM_ITEMS. Figure 19 – Entity Declaration form with the Item entity defined and setup of Primary Key 12) Define an attachment in the master items form for an item (Organization Item). select a valid Category.

Go to Application Developer responsibility > go to Attachments> Document Categories. Figure 23 – Check if the attachment icon is enabled on Sales Order line 19 .13) Check if the category: Miscellaneous (as selected in Figure 21 above) has the Sales Order form assigned to it. query for Sales Orders. Query for category: Miscellaneous(Figure 22) Figure 22 – Document Category form for Miscellaneous category Go to Assignments button and in Category Assignments. Figure 22 – Check if Sales Order is present and enabled in Category Assignments window 14) Create a sales order having a sales order line for this item and save it (Figure 23).

Figure 24 – Open the attchment icon and check if the correct attachment is visible Note: The ship_from_org_id/warehouse and the organization in which document is defined in the master item should be same.See the Attachment icon is enabled on Sales Order form and the attachment text is visible when opening the attachment (Figure 24). 20 .

CA 94065 U.Automatic Attachments in Order Management Author: Marian Stan Senior Technical Support Engineer Global Product Support Special thanks to Aditya Mallik. Oracle is a registered trademark of Oracle Corporation and/or its affiliates.7200 oracle. This document may not be reproduced or transmitted in any form or by any means. Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores. Oracle and/or its affiliates.7000 Fax: +1. Other names may be trademarks of their respective Copyright © 2008. Worldwide Inquiries: Phone: +1. This document is provided for information purposes only and the contents hereof are subject to change without notice. We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. electronic or mechanical. including implied warranties and conditions of merchantability or fitness for a particular purpose. Senior Applications Engineer in OM Development team for their great help in reviewing and providing valuable suggestions for improving this whitepaper. without our prior written permission. This document is not warranted to be error-free. Manager of OM Development team and Chidananda Pati. nor subject to any other warranties or conditions. 21 . whether expressed orally or implied in law.A. All rights reserved.506. for any purpose.