Sunday, July 18, 2021

How to get URL Link for the attachments in Oracle Apps

 FUNCTION xx_attachment_url(p_po_header_id IN NUMBER

  ,p_vendor_id    IN NUMBER

  )

RETURN CHAR 

IS 

ln_gfm_id NUMBER; 

lc_gfm_agent VARCHAR2 (250); 

lc_url VARCHAR2 (2000); 

ln_media_id  NUMBER; 

begin 

SELECT DISTINCT dt.media_id 

  INTO ln_media_id 

  FROM fnd_attached_documents ad

      ,fnd_documents_tl dt 

WHERE(

(entity_name = 'PO_HEADER' 

AND pk1_value = :p_po_header_id 

AND pk2_value = '1'

OR (entity_name = 'PO_HEADERS' 

AND pk1_value = :p_po_header_id

    ) 

OR (entity_name = 'PO_VENDORS' 

AND pk1_value = :p_vendor_id)) 

   AND ad.document_id=dt.document_id 

   AND dt.language = USERENV('LANG') 

   AND ROWNUM<2

   ; 

lc_gfm_agent := fnd_web_config.gfm_agent; 

ln_gfm_id := ln_media_id;

lc_url := fnd_gfm.construct_download_url (lc_gfm_agent, ln_gfm_id, FALSE); 

RETURN lc_url; 

EXCEPTION 

WHEN OTHERS THEN 

RETURN(NULL); 

END;


1 comment:

SupplierAddressImportTemplate.xlsm South Africa Suburb Field mapping in POZ_SUPPLIER_ADDRESSES_INT

Suburb mpping in Supplier Address Import Template will be mapped to Address Element Attribute2 (HZ_LOCATIONS. ADDR_ELEMENT_ATTRIBUTE2)