Attachments in Oracle Form
默認情況下“附件”按鈕是灰顯的,本文將展示如何讓某個Form的附件按鈕變亮,并能上傳附件.
以用戶Form為例,我們想讓用戶上傳自己的照片
Pre-Setups
Help > Diagnostics > Custom Code > Personalize,記錄下Function Name
并用Help > Diagnostics > Examine查看User Name字段和User ID字段對應的Field名稱
我們將會在后邊的步驟里使用USER_ID和USER_NAME
Setups
接下來就在Application Developer職責下,要配置Attachment
Step 1: Create document entity
Navigation: Application Developer > Responsibility > Attachments > Document Entities
(Entity:An entity is an object within Oracle Applications data, such as an item, an order, or anorder line. The attachments feature must be enabled for an entity before users can link attachments to the entity.)
Step 2: Create attachment function
Navigation: Application Developer > Responsibility > Attachment > Attachment Functions
選擇Function,Name就是我們在文章剛開始時,查得的Function Name。再點Category,選擇附件類型
Block,Entity為Block的名稱
Entities
Step 3: Add document category
Navigation:Application Developer > Responsibility > Attachment > Document Categories
(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.
In the below example i am trying to enable the attachment funcionality for the USer form..I want to upload the approval copy for creating a user or attaching new responsibility)
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).
這樣附件的設置就算完成了。可以到用戶form上,可以看到附件的按鈕就變亮了。
點附件按鈕,就可以上傳附件了
上傳之后
Query To Check
=================================================
Attachment Related Tables
1. FND_DOCUMENTS
2. FND_ATTACHED_DOCUMENTS
3. FND_DOCUMENTS_TL
4. FND_DOCUMENT_DATATYPES.
5. FND_DOCUMENT_CATEGORIES
6. FND_DOCUMENTS_LONG_TEXT (Long text type attachment).
7. FND_DOCUMENTS_SHORT_TEXT (Short text type attachment).
8. FND_DOCUMENTS_LONG_RAW
9. FND_LOBS (File type attachments).
FND_DOCUMENTS:
FND_DOCUMENTS stores language-independent information about a document. For example, each row contains a document identifier, a category identifier, the method of security used for the document (SECURITY_TYPE, where 1=Organization,2=Set of Books, 3=Business unit,4=None), the period in which the document is active, and a flag to indicate whether or not the document can be shared outside of the security type (PUBLISH_FLAG).
Other specifications in this table include: datatype (DATATYPE_ID, where 1=short text,2=long text, 3=image, 4=OLE object), image type, and storage type (STORAGE_TYPE, where 1=stored in the database, 2=stored in the file system).
The document can be referenced by many application entities and changed only in the define document form (USAGE_TYPE=S); it can be used as a fill-in-the-blanks document, where each time you use a template, you make a copy of it (USAGE_TYPE=T); or it can be used only one time (USAGE_TYPE=O).Images and OLE Objects cannot be used as templates.
FND_ATTACHED_DOCUMENTS:
FND_ATTACHED_DOCUMENTS stores information relating a document to an application entity.? For example, a record may link a document to a sales order or an item. Each row contains foreign keys to FND_DOCUMENTS and FND_DOCUMENT_ENTITIES. There is also a flag to indicate whether or not an attachment was created automatically.
FND_DOCUMENTS_TL:
FND_DOCUMENTS_TL stores translated information about the documents in FND_DOCUMENTS. Each row includes the document identifier, the language the row is translated to, the description of the document, the file in which the image is stored, and an identifier (MEDIA_ID) of the sub-table in which the document is saved (FND_DOCUMENTS_SHORT_TEXT, FND_DOCUMENTS_LONG_TEXT, or FND_DOCUMENTS_LONG_RAW).
FND_DOCUMENT_DATATYPES:
FND_DOCUMENT_DATATYPES stores the document datatypes that are supported. Initial values are: short text, long text, image, and OLE Object (DATATYPE_ID=1, 2, 3, or 4). Customers can add datatypes to handle documents stored outside of Oracle and use non-native Forms applications to view/edit their documents. The table uses a “duplicate record” model for handling multi-lingual needs. That is, for each category there will be one record with the same CATEGORY_ID and CATEGORY_NAME for each language.
FND_DOCUMENT_CATEGORIES:
FND_DOCUMENT_CATEGORIES stores information about the categories in which documents are classified. For example, documents may be considered “Bill of Material Comments”, “WIP Job Comments”, etc. Document categories are used to provide a measure of security on documents.?Each form that enables the attachment feature lists which categories of documents can be viewed in the form. This table uses a “duplicate record” model for handling multi-lingual needs.
FND_DOCUMENTS_LONG_TEXT:
FND_DOCUMENTS_LONG_TEXT stores information about long text documents.
FND_DOCUMENTS_SHORT_TEXT:
FND_DOCUMENTS_SHORT_TEXT stores information about short text documents.
FND_DOCUMENTS_LONG_RAW:
FND_DOCUMENTS_LONG_RAW stores images and OLE Objects, such as Word Documents and Excel spreadsheets, in the database.
FND_DOCUMENT_ENTITIES:
FND_DOCUMENT_ENTITIES lists each entity to which attachments can be linked. For example, attachments can be linked to Items, Sales Orders, etc. Since the table uses a “duplicate record” model for handling multi-lingual needs, for each document entity there will be one record with the same DOCUMENT_ENTITY_ID and DATA_OBJECT_CODE for each language.
Useful Queries
To find all Long Text attachments:
SELECTFAD.SEQ_NUM "Seq Number",FDAT.USER_NAME "Data Type",FDCT.USER_NAME "Category User Name",FAD.ATTACHED_DOCUMENT_ID "Attached Document Id",FDET.USER_ENTITY_NAME "User Entity",FD.DOCUMENT_ID "Document Id",FAD.ENTITY_NAME "Entity Name",FD.MEDIA_ID "Media Id",FD.URL "Url",FDT.TITLE "Title",FDLT.LONG_TEXT "Attachment Text" FROMFND_DOCUMENT_DATATYPES FDAT,FND_DOCUMENT_ENTITIES_TL FDET,FND_DOCUMENTS_TL FDT,FND_DOCUMENTS FD,FND_DOCUMENT_CATEGORIES_TL FDCT,FND_ATTACHED_DOCUMENTS FAD,FND_DOCUMENTS_LONG_TEXT FDLT WHEREFD.DOCUMENT_ID = FAD.DOCUMENT_IDAND FDT.DOCUMENT_ID = FD.DOCUMENT_IDAND FDCT.CATEGORY_ID = FD.CATEGORY_IDAND FD.DATATYPE_ID = FDAT.DATATYPE_IDAND FAD.ENTITY_NAME = FDET.DATA_OBJECT_CODEAND FDLT.MEDIA_ID = FD.MEDIA_IDAND FDAT.NAME = 'LONG_TEXT';To find all Short Text attachments: SELECTFAD.SEQ_NUM "Seq Number",FDAT.USER_NAME "Data Type",FDCT.USER_NAME "Category User Name",FAD.ATTACHED_DOCUMENT_ID "Attached Document Id",FDET.USER_ENTITY_NAME "User Entity",FD.DOCUMENT_ID "Document Id",FAD.ENTITY_NAME "Entity Name",FD.MEDIA_ID "Media Id",FD.URL "Url",FDT.TITLE "Title",FDST.SHORT_TEXT "Attachment Text" FROMFND_DOCUMENT_DATATYPES FDAT,FND_DOCUMENT_ENTITIES_TL FDET,FND_DOCUMENTS_TL FDT,FND_DOCUMENTS FD,FND_DOCUMENT_CATEGORIES_TL FDCT,FND_ATTACHED_DOCUMENTS FAD,FND_DOCUMENTS_SHORT_TEXT FDST WHEREFD.DOCUMENT_ID = FAD.DOCUMENT_IDAND FDT.DOCUMENT_ID = FD.DOCUMENT_IDAND FDCT.CATEGORY_ID = FD.CATEGORY_IDAND FD.DATATYPE_ID = FDAT.DATATYPE_IDAND FAD.ENTITY_NAME = FDET.DATA_OBJECT_CODEAND FDST.MEDIA_ID = FD.MEDIA_IDAND FDAT.NAME = 'SHORT_TEXT';
WEBPAGE ATTACHMENT
SELECT DISTINCTAD.SEQ_NUM ,DCT.USER_NAME , DAT.USER_NAME ,D.STORAGE_TYPE ,D.FILE_NAME ,D.IMAGE_TYPE ,D.USAGE_TYPE ,AD.AUTOMATICALLY_ADDED_FLAG ,AD.ATTACHED_DOCUMENT_ID ,DET.USER_ENTITY_NAME ,D.DATATYPE_ID ,DAT.NAME ,D.DOCUMENT_ID , D.START_DATE_ACTIVE ,D.END_DATE_ACTIVE ,D.SECURITY_TYPE ,D.SECURITY_ID ,D.PUBLISH_FLAG ,AD.CREATED_BY ,DET.USER_ENTITY_PROMPT ,AD.ENTITY_NAME ,AD.COLUMN1 ,AD.PK1_VALUE , D.MEDIA_ID ,D.CATEGORY_ID ,D.URL ,DT.TITLE FROM FND_DOCUMENT_DATATYPES DAT,FND_DOCUMENT_ENTITIES_TL DET ,FND_DOCUMENTS_TL DT ,FND_DOCUMENTS D ,FND_DOCUMENT_CATEGORIES_TL DCT , FND_ATTACHED_DOCUMENTS AD WHERE D.DOCUMENT_ID = AD.DOCUMENT_ID AND DT.DOCUMENT_ID = D.DOCUMENT_ID AND DCT.CATEGORY_ID = D.CATEGORY_ID AND D.DATATYPE_ID = DAT.DATATYPE_ID AND AD.ENTITY_NAME = DET.DATA_OBJECT_CODE AND DAT.name = 'WEB_PAGE';FILE ATTACHMENT SELECTAD.SEQ_NUM ,DCT.USER_NAME , DAT.USER_NAME , AD.ATTACHED_DOCUMENT_ID ,DET.USER_ENTITY_NAME , DAT.NAME ,D.DOCUMENT_ID , AD.ENTITY_NAME , AD.PK1_VALUE , D.MEDIA_ID , D.URL ,DT.TITLE ,DBMS_LOB.SUBSTR(L.file_data,1,10) file_data FROM FND_DOCUMENT_DATATYPES DAT,FND_DOCUMENT_ENTITIES_TL DET ,FND_DOCUMENTS_TL DT ,FND_DOCUMENTS D ,FND_DOCUMENT_CATEGORIES_TL DCT , FND_ATTACHED_DOCUMENTS AD ,FND_LOBS L WHERE D.DOCUMENT_ID = AD.DOCUMENT_ID AND DT.DOCUMENT_ID = D.DOCUMENT_ID AND DCT.CATEGORY_ID = D.CATEGORY_ID AND D.DATATYPE_ID = DAT.DATATYPE_ID AND AD.ENTITY_NAME = DET.DATA_OBJECT_CODE AND L.FILE_ID = D.MEDIA_ID AND DAT.name = 'FILE';
Find the functions using attachments SELECTAD.SEQ_NUM ,DCT.USER_NAME , DAT.USER_NAME , AD.ATTACHED_DOCUMENT_ID ,DET.USER_ENTITY_NAME , DAT.NAME ,D.DOCUMENT_ID , AD.ENTITY_NAME , AD.PK1_VALUE , D.MEDIA_ID , D.URL ,DT.TITLE ,AF.FUNCTION_NAME ,AF.FUNCTION_TYPE FROM FND_DOCUMENT_DATATYPES DAT,FND_DOCUMENT_ENTITIES_TL DET ,FND_DOCUMENTS_TL DT ,FND_DOCUMENTS D ,FND_DOCUMENT_CATEGORIES_TL DCT ,FND_DOC_CATEGORY_USAGES DCU ,FND_ATTACHMENT_FUNCTIONS AF ,FND_ATTACHED_DOCUMENTS AD WHERE 1 = 1 AND D.DOCUMENT_ID = AD.DOCUMENT_ID AND DT.DOCUMENT_ID = D.DOCUMENT_ID AND DCT.CATEGORY_ID = D.CATEGORY_ID AND DCU.CATEGORY_ID = D.CATEGORY_ID AND DCU.ATTACHMENT_FUNCTION_ID = AF.ATTACHMENT_FUNCTION_ID AND D.DATATYPE_ID = DAT.DATATYPE_ID AND AD.ENTITY_NAME = DET.DATA_OBJECT_CODE AND DCU.ENABLED_FLAG = 'Y';
Reference
http://imdjkoch.wordpress.com/2010/09/02/attachment-in-oracle-application/
http://erpschools.com/articles/oracle-attachment-functionality-adding-an-attachment-to-a-form
http://oraclemaniac.com/2012/04/23/enable-attachment-button-for-an-oracle-apps-form/
http://www.centroid.com/knowledgebase/blog/how-to-enable-attachments-in-oracle-e-business-suite-release-12
http://oracleappstechnicalworld.blogspot.jp/2008/04/attachment-functionality-in-oracle.html
http://www.shareoracleapps.com/2010/06/fnd-attachments-in-oracle-apps-r12.html
總結
以上是生活随笔為你收集整理的Attachments in Oracle Form的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 博弈论基础-蒋文华(浙大)
- 下一篇: python程序设计基础与应用 机械工业