Sunday, 11 November 2018

API to Update Oracle Fnd Attachment Informations : api to update fnd_attached_documents

API to Update Oracle Fnd Attachment Information's : api to update fnd_attached_documents

In this post , We will discuss about how we can update the Oracle fnd attachment information's. Oracle has given the API to update any attachment information in the Oracle. I have used this API to update the URL related information's in the oracle fnd_attached_documents. You can refer this program to update or change any existing Oracle Fnd Attachment Information's for any entity like PO, Invoices , Sale Order and PO Requisitions.
 

 

Sample Script of API to Update Oracle Fnd Attachment Information's : api to update fnd_attached_documents

 
 Declare

 l_rowid                ROWID;
   l_attached_document_id NUMBER;
   l_document_id          NUMBER;
   l_media_id             NUMBER;
   l_user_id              NUMBER;
   l_category_id          NUMBER;
   l_pk1_value            fnd_attached_documents.pk1_value%TYPE;
   l_description          fnd_documents_tl.description%TYPE;
   l_seq_num           NUMBER;
   lv_short_text       VARCHAR2(1000);
   lv_bill_address1    VARCHAR2(1000);
   lv_bill_address2    VARCHAR2(1000);
   lv_bill_city        VARCHAR2(1000);
   lv_bill_state       VARCHAR2(1000);
   lv_bill_countryid   VARCHAR2(1000);
   lv_bill_postalcode  VARCHAR2(1000);
   l_title             VARCHAR2(1000);
   l_security_id       NUMBER;
   l_security_type     NUMBER;
   l_data_type_id      NUMBER;
   l_storage_type      VARCHAR2(1000);
   l_image_type        VARCHAR2(1000);
   l_start_date_active DATE;
   l_end_date_active   DATE;
   l_usage_type        VARCHAR2(1000);
   lv_notes_cnt        NUMBER;
   lv_bill_company     VARCHAR2(1000);
   begin
  
   l_document_id:=232338279;
 SELECT description,
            title,
            fd.media_id,
            fd.security_id,
            fd.storage_type,
            fd.image_type,
            fd.start_date_active,
            fd.end_date_active,
            fd.usage_type,
            fd.category_id,
            fd.datatype_id,
            fd.security_type
       INTO l_description,
            l_title,
            l_media_id,
            l_security_id,
            l_storage_type,
            l_image_type,
            l_start_date_active,
            l_end_date_active,
            l_usage_type,
            l_category_id,
            l_data_type_id,
            l_security_type
       FROM fnd_documents_tl fdt, fnd_documents fd
      WHERE fdt.document_id = fd.document_id
        AND fdt.document_id = l_document_id;
       fnd_documents_pkg.update_row(x_document_id       => l_document_id,
                                    x_last_update_date  => SYSDATE,
                                    x_last_updated_by   => 23675,
                                    x_last_update_login => 23675,
                                    x_datatype_id       => 5,--l_data_type_id,
                                    x_category_id       => l_category_id,
                                    x_security_type     => 1,--l_security_type,
                                    x_security_id       => l_security_id,
                                    x_publish_flag      => 'Y',
                                    x_image_type        => l_image_type,
                                    x_storage_type      => l_storage_type,
                                    x_usage_type        => 'O',
                                    x_start_date_active => l_start_date_active,
                                    x_end_date_active   => l_end_date_active,
                                    x_language          => 'US',
                                    x_description       => l_description,
                                    x_url               => 'Enter any URL as required for Parameter'
                                    x_file_name         => NULL,
                                    x_media_id          => l_media_id,
                                    x_title             => l_title);

     END;

0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *