How to display Attachments on OAF page for different entities

Hi,
I have a requirement where I have to create an attachment page to display the attachments dynamically at run time depending upon the values passed such as Entity Name, Primary Key values, Category Id values.
I have a query to give me the attachments related data from the tables like fnd_documents_vl, fnd_attached_documents, fnd_document_entities, fnd_document_categories_tl.
Now, as I read on the forum, I can make use of Oracle's seeded functionality on attachments and display attachments but in my requirement I don't have one specific entity. I have below query which gives data directly with respect to all entities from fnd tables. The name of entity and primary keys will come at run time. So, how can I make use of below query and display attachments in such a case?
I am very new to OAf and any help will be really appreciated.
Thanks in Advance,
Shalini
SELECT DISTINCT ad.attached_document_id
,ad.document_id AS document_id
,ad.last_update_date
,ad.last_updated_by
,u.user_name last_updated_by_name
,ad.entity_name
,ad.pk1_value
,ad.pk2_value
,ad.pk3_value
,ad.pk4_value
,ad.pk5_value
,decode(d.dm_node,
NULL,
(SELECT short_name
FROM fnd_dm_nodes
WHERE node_id = 0),
0,
(SELECT short_name
FROM fnd_dm_nodes
WHERE node_id = 0),
node.short_name) location
,d.document_id document_id1
,d.datatype_id
,d.datatype_name
,d.description
,decode(d.file_name,
NULL,
(SELECT message_text
FROM fnd_new_messages
WHERE message_name = 'FND_UNDEFINED'
AND application_id = 0
AND language_code = userenv('LANG')),
d.file_name) file_name
,d.media_id
,d.dm_type
,d.dm_node
,d.dm_folder_path
,e.data_object_code
,e.document_entity_id
,'ALLOW_ATTACH_UPDATE' allow_attach_update
,'ALLOW_ATTACH_DELETE' allow_attach_delete
,ad.category_id category_id
,cl.user_name attachment_category_name
,ad.status
,ad.creation_date
,(SELECT u1.user_name
FROM fnd_user u1
WHERE u1.user_id = ad.created_by) attached_by_name
,decode(d.datatype_id,
5,
nvl(d.title,
d.description) || '(' ||
substr(d.url,
1,
least(length(d.url),
15)) || '...)',
decode(d.datatype_id,
6,
nvl(d.title,
d.file_name),
decode(d.title,
NULL,
(SELECT message_text
FROM fnd_new_messages
WHERE message_name = 'FND_UNDEFINED'
AND application_id = 0
AND language_code =
userenv('LANG')),
d.title))) file_name_sort
,d.usage_type
,d.security_id
,d.security_type
,d.publish_flag
,cl.category_id category_id_query
,ad.seq_num
,d.url
,d.title
FROM fnd_documents_vl d
,fnd_attached_documents ad
,fnd_document_entities e
,fnd_user u
,fnd_document_categories_tl cl
,fnd_dm_nodes node
WHERE ad.document_id = d.document_id
AND ad.entity_name = e.data_object_code(+)
AND ad.last_updated_by = u.user_id(+)
AND cl.LANGUAGE = userenv('LANG')
AND cl.category_id = nvl(ad.category_id,
d.category_id)
AND d.dm_node = node.node_id(+)

Hi Peddy,
Thanks a lot for your guidance. I tried implementing the code in PR but I am stuck at one error. I am not able to programmatically add a new Entity ID and its attributes at run time. To make it more clear: In Jdev I created an Entity and its mappings at design time. Now, I am able to use getEntitymappings() and setEntityMappings() to modify the attributes of exiting Enity but I am not able to add/append new Entity ID to the existing one. It throws - java.lang.ArrayIndexOutOfBoundsException: 1 error.
Please any one review the below code snippet and let me know whether I am missing something to make it work.
Below is the Code that I have written so far:
====================================================
OAAttachmentTableBean attBean = (OAAttachmentTableBean)webBean.findChildRecursive("attachTable");
Dictionary[] entityMaps = attBean.getEntityMappings();
entityMaps[0].remove("entityId");
entityMaps[0].put("entityId","OE_ORDER_HEADERS");
entityMaps[0].remove("insertAllowed");
entityMaps[0].remove("updateAllowed");
entityMaps[0].remove("deleteAllowed");
entityMaps[0].put("insertAllowed", false);
entityMaps[0].put("updateAllowed", false);
entityMaps[0].put("deleteAllowed", false);
// Adding Second Entity
// Getting ArrayIndexOutOfBoundsException at below line. As i saw that getEntityMappings() returns only array of size :1 and that is teh reason I am getting error, so How can I increase the size dynamically to add new Entity or is there any other way?
entityMaps[1].put("entityId", "XX_LINK_ENTITY"); // entity id
entityMaps[1].put("showAll", false); // show all property
entityMaps[1].put("insertAllowed", false);
entityMaps[1].put("deleteAllowed", false);
entityMaps[1].put("updateAllowed", false);
// Adding Primary Key to Second Entity
String[] pkAttrNames = new String[1];
pkAttrNames[0] = "Pk1Value"; // pk view attribute name
entityMaps[1].put("pkColumns", pkAttrNames);
// Setting Category Values for first Entity
Integer CatValue = 1000486;
Integer[] categories = new Integer[2]; // categories
categories[0] = new Integer(1);
categories[1] = CatValue;
// Setting Category Values for Second Entity
Integer[] categories2 = new Integer[1]; // categories
categories2[0] = new Integer(1); //MISC
attBean.setEntityMappings(entityMaps);
attBean.setDynamicCategoriesMap("OE_ORDER_HEADERS",categories);
attBean.setDynamicCategoriesMap("XX_LINK_ENTITY",categories2);
Thanks & Best Regards,
Shalini

Similar Messages

  • How to do attachments in oaf page  and save

    Dear Friends
    I need to develop a  create page and in this i have to make a facility to user to attach their files .How to do this .Plz share any ideas.
    If know any standard  pages .plz share page paths.
    PLEASE HELP
    Thanks
    Aravinda

    Hi,
    Check below links:
    http://oraclearea51.com/premium-content/32-technical-articles/oaf-beginners-guide/288-adding-attachments-in-a-oaf-page.html
    http://apps2fusion.com/at/85-daxesh/516-oa-framework-attachment-region
    --Sushant

  • Restirct OAF page for a user

    Hi All,
    How can i restrict a page for a user.
    That is I don't want a particular user to modify the page.
    So how can i hide a OAF page from the user.
    When the user logs in the page or responsibility must not be shown.
    Thanks & Regards,
    Jeganathan R

    Extend the controller and write code to set property of button according to the user Login.
    Capture the user name in PR of controller then enable or disable button as per your requirement.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How can I make a intro page for my website, then after the intro has run make the page automatically change to my we site home screen

    how can I make a intro page for my website, then after the intro has run make the page automatically change to my website's home screen

    You can do this using a meta refresh but the problem is you have to add it to the html file for the page very time you publish changes.
    A better way is to create a splash page and upload it to the server outside of the folder produced by iWeb. Example HERE.
    The meta refresh is added to the head section of the html file...
    <meta http-equiv="refresh" content="32;url=http://www.domain.about.com/Page-Name.html">
    The delay time in seconds is marked in blue and the URL to the redirect page is in red.

  • How do I name documents in Pages for iPad?

    How do I name documents in Pages for iPad?
    When I create a new documents in Pages it is saved simply as Blank. I need to be able to edit this and give my new document a name such as "Pricing Proposal", etc.
    Is this possible in Pages for iPad, and if so how do I go about it?

    Ah yes: that works. I swear I tried that when searching for how to do this, but I must not have held my finger down long enough.
    Thank you so much for your help

  • How to integrate address book in Pages for iPad?

    In Pages for Mac, I could drag Address Book entries directly into Pages to automatically populate Name and Address placeholders.
    How do I do that in Pages for iPad?
    Currently, iOS Pages does not pull my details (name & address) automatically into letter templates either, as is the case with Mac Pages.

    I have the same problem / need.
    Does anybody know if there is any sort of integration of iOS pages with Contacts in iPad / iPhone?

  • How to display the selection screen fields for selected checkboxes

    Hi all,
             I have 7 checkboxes, for each check box we have some seletion screen fields.if i select first check box,i want to display first slection screen fields only.
    and if we select more than one check box how to display the selection screen fields for selected check boxes,please help me this
    Thanks
    sriman.

    hi,
    Try this code
    report z_13317_sdn2.
    tables : mara, marc, dd03l.
    parameters : p_chk1 as checkbox user-command ABC,
                 p_chk2 as checkbox user-command PQR,
                 p_chk3 as checkbox user-command XYZ.
    select-options : s_matnr for mara-matnr modif id A,
                     s_ersda for mara-ersda modif id A,
                     s_werks for marc-werks modif id B,
                     s_lvorm for marc-lvorm modif id B,
                     s_tab for dd03l-tabname modif id C.
    data: v_chk1,
          v_chk2,
          v_chk3.
    at selection-screen output.
      loop at screen.
        if screen-group1 = 'A' or
           screen-group1 = 'B' or
           screen-group1 = 'C'.
            screen-input = 0.
           modify screen.
        endif.
      endloop.
      loop at screen.
        if v_chk1 = 'X'.
          if screen-group1 = 'A'.
            screen-input = 1.
            modify screen.
          endif.
        endif.
        if v_chk2 = 'X'.
          if screen-group1 = 'B'.
            screen-input = 1.
            modify screen.
          endif.
        endif.
        if v_chk3 = 'X'.
          if screen-group1 = 'C'.
            screen-input = 1.
            modify screen.
          endif.
        endif.
      endloop.
    at selection-screen.
      if sy-ucomm = 'ABC'.
        if v_chk1 = ' '.
          v_chk1 = 'X'.
        else.
          v_chk1 = ' '.
        endif.
      endif.
      if sy-ucomm = 'PQR'.
        if v_chk2 = ' '.
          v_chk2 = 'X'.
        else.
          v_chk2 = ' '.
        endif.
      endif.
      if sy-ucomm = 'XYZ'.
        if v_chk3 = ' '.
          v_chk3 = 'X'.
        else.
          v_chk3 = ' '.
        endif.
      endif.
    Regards,
    Sailaja.

  • How do I set the home page for a new tab?

    How do I set the web page for when I open a new tab? Whenever I open a new tab it goes to an error site which freezes my firefox browser for a while. How do I change that? I want to open new tabs with google being the home page. I need to set up the homepage for a new tab NOT a new window. Please help! !

    If Google is set as your Homepage in Firefox you can middle-click ''(push down on the mouse wheel)'' to open Google in a new Tab.
    Or, you can add the feature to Firefox where clicking the New Tab button on the Tab Bar opens your Homepage in a new Tab. <br />
    https://addons.mozilla.org/en-US/firefox/addon/new-tab-homepage/
    And if you have a different Homepage set, this extension allows for any page you set in the extension's options to open when you use the new Tab button. <br />
    https://addons.mozilla.org/en-US/firefox/addon/newtaburl/

  • How to change sentence Case in Pages for ios

    Hi,
    does anyone anyone know how to change sentence case in Pages for IPad.
    I Mean from UPPER CASE TO lower case.

    The IOS version of Pages has no Format > Font > Capitalization facility to transform uppercase text into other case forms. You need to use Pages v5.2.2 on OS X, or export to Word, and use most any other Word compatible word processor. If it is a couple of words, then retype them in the appropriate case.

  • How to display region from one page on the other page?

    Hi,
    I'd like to ask if someone know how to display region created on page X on page Y.
    I've tried to create a "URL" region on Y but this doesn't work and I generally think this is blind way.
    Next I've found an internal function "flows_020100.wwv_flow_disp_page_plugs()" that works pretty well (PL/SQL type region with calling the function) except that is displaying only regions on the same page. I know it's dirty hack but ...
    Any ideas or hints how to solve this? Thanks ...

    have a look here ...
    http://www.oracle.com/technology/products/database/application_express/pdf/apex_best_practices.pdf

  • Urgent please: Master-Deatils OAF Page for enter and Update data

    Hi all,
    i need your help to build master-details oaf page for Enter / Update data
    for example: We have Locations , Department , Employees tables
    all these tables on one oaf page (OAAdvancedTable)
    when user enter New Location and go to Enter it's Departments and for each department, he can Enter they employees.
    and Regarding to Update date:
    - when user select Location , Department table fetch all departments and user can update
    waiting your support for urgent please
    Regards
    Hany

    i do these Steps :
    1- Create LocationEO,DepartmentEO and EmployeesEO
    2- Create Association between LocationEO and DepartmentEO with one-to-Many relation (LocToDeptAO)
    3- Create Association between DepartmentEO and EmployeesEO with one-to-Many relation (DeptToEmpAO)
    4- Create View Object (LocationVO)
    5- Create DepartmentVO (and add LocationEO due to LocToDeptAO)
    6- Create EmployeesVO (and add DepartmentEO due to DeptToEmpAO)
    7- Creare View Link between LocationVO and DepartmentVO (Based On LocToDeptAO) --> LocToDeptVL
    8- Creare View Link between DepartmentVO and EmployeesVO (Based On DeptToEmpAO)---> DeptToEmpVL
    9- Add LocaionVO to Application Module, then add DepartmentVO Via (LocToDeptVL)
    10-Add EmployeesVO to Application Module Via (DeptToEmpVL)
    and Then Run Test AM, all data fetch sucessfully, and i can insert data with proper relations
    NOw, i want to implement this Business Logic in single oaf Page using 3 OAAdvancedTable (Master - Details -Details )
    Regards

  • How many is the maximum application pages for an iPhone?

    how many is the maximum application pages for an iPhone?

    Used to be 11, not sure but you can check here http://manuals.info.apple.com/en_US/iphone_user_guide.pdf

  • How do i create 2 parameter pages for 1 report?

    Hi,
    I want to make a purchase order report. first: i need a parameter page to ask how many items that you want to order. second, once user enters a number(let's say 5), i want to have anoter parameter page show 5 empty fields that user can enter 5 items' barcode#, once they entered barcodes, the report will show these 5 items info.
    my difficulty is how do i create 2 parameter page for 1 report?
    thank you

    my question
    1- there is any way to assign the Fetch process to specific region so the process take all item in these region only.
    2- how can create manual process to fetch row into specific items in page ( i tray these code
    SELECT col1, col2, col3 ....
    INTO :P1_ITEM1, :P1_ITEM, :P1_ITEM...
    FROM table
    WHERE id = :P_id ) but no data retrieve .
    I do not think that it is possible to have more than one Automated Row Fetch process in a given page. See the thread:
    ORA-01403: no data found : Unable to fetch row multiple automated row fetch
    On your second question, the manual process should work provided:
    P_ID has a value when the process executes. You can do it this way:
    i. Make this process as a on-load After/Before header process
    ii. Make sure that P_ID page item has value when the process executes (set it from another page or before the pl/sql process executes)

  • How to display the entire application in two different languages in apex

    Hi,
    How to display the entire application in two different languages in apex...
    For example i need to display each item in both English and Hindi..
    To achieve this initially i have the select the language otherwise the item label alone ll be displayed in both languages ...
    Anyhow how it ll be apex is it possible
    Regards,
    Pavan

    Hi pars,
    http://www.packtpub.com/sites/default/files/1346-chapter-6-creating-multilingual-apex-applications.pdf?utm_source=packtp…
    In this link also i struck in
    In page 10  of that document
    The application is now ready to be translated. Everything is in place to run it in any language imaginable.To ca ll the application in another language, change the URL of your application to the following:
    http://yourdomain:port/pls/apex/f?p=&APP_ID.:&PAGE_ID.:&SESSION_ID.:LANG:NO::FSP_LANGUAGE_PREFERENCE:nl
    This example will call the chosen page in the application and show it in the Dutch language instead of in English. To select another language change the property nl at the end of the URL to your desired language code.
    Thanks alot for ur suggestions.kindly provide more inputs..............

  • Displaying variable no. of fields for different records

    Hi,
    I have the requirement of displaying variable no of fields for different type of record in the business object.How can this be done in VC. For example i have to show an extra field for country "IN"
    Thanks in advance,
    Regards,
    Anupam

    Hi Anupam,
    Please explain ur requirement more clearly.
    If understanding is right ,you are creating a Table/Form with the information of a particular company ,and u r interested to add another column to this table and this column should not be visible when to select another company. Am I right?
    What is the data source is it a BAPI or Query or Query View?
    1)Drag and drop a table from the Query(if suppose).Or form if u want to include in the form.
    2)And if u want another field(if it is to be calculated) in ur table u can have include an expression box by clicking a "+" sign in the table and specify the formula for it in the Expression field uder the Data source field in the General Tab.
    3)And if u want to hide this field when u select another country then u can set a visibility condition.
    4)Go to control properties window of the new field.U can get this by selecting the new added field and by clicking on configure or by left clicking the new field and then selecting the properties.
    5)Inside the General Tab, u have UI Control,below that u have Hidden which is a check box, just check it.And click on condition. Then type the condition for it to be hidden.Then it is hidden.
    Please try doing the above.
    Reward me with points if its helpful.
    Thanks,Regards,
    Sripriya Srinivasan.

Maybe you are looking for

  • Problem with firmware in a Zen Jukebox 3

    Well, I've got a mp3 player, a Creative Zen Jukebox with a HD of 30GB. The other day I started it and it began to re-built the music library, but it blocks in the middle of the process and shows a message: firmware problem. And here it sto ps. I can

  • Can i create an instance of ArrayList ?

    hi , I need to store first name, last name etc in an ArrayList for a unique userid. And i have to do it for few userids. on successful login of the user ( with unique userid that matches with the one in the arraylist), i need to retrieve user details

  • Message Mapping for multiple item levels

    Hi, My query is regarding message mapping Example of source data structure & Target data structure Source data Structure <item>       --<no>1</no>       --<address/>       --<ITEMS>         ----<item>           ------<Name>a</Name>         ----<item>

  • Severe error in the log file of App Server 8.1 PE

    Hi, I have installed the JWSDP 1.6 with my App Server 8.1 PE and i found an error that i could not solve. The error message reads "EJB Webservice security configuration Failure com.sun.enterprise.security.jauth.AuthException at com.sun.enterprise.sec

  • Missing user profiles in mysites

    I have a question about missing user profiles in our Mysites. We have an SP2013 environment with a number of site collections and sub-sites and occasionally, we are finding that some users are missing their profile. If we click on their user name, in