0% found this document useful (0 votes)
12 views2 pages

Attachment API

The document provides a script for attaching a URL to an Accounts Payable (AP) invoice in Oracle Applications using the fnd_webattch.add_attachment API. It includes details on setting the organization context, retrieving category and invoice IDs, and handling exceptions. The script is intended for users familiar with Oracle's development environment and requires specific input values for execution.

Uploaded by

satish1981
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Attachment API

The document provides a script for attaching a URL to an Accounts Payable (AP) invoice in Oracle Applications using the fnd_webattch.add_attachment API. It includes details on setting the organization context, retrieving category and invoice IDs, and handling exceptions. The script is intended for users familiar with Oracle's development environment and requires specific input values for execution.

Uploaded by

satish1981
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Co

nfi
de
nti
al - URL Attachment
Ora
cle
Res
tric R12: Attach URL to AP Invoice through API/Script
ted Background:
This post illustrates implementing attachment functionality in Oracle Applications
through fnd_webattch.add_attachment API

Script:
declare
v_category_id NUMBER;
v_description VARCHAR2(200) := 'Attach the url to AP Inv';
v_invoice_image_url VARCHAR2(200) := '[Link]
v_function_name VARCHAR2(50) := 'APXINWKB';--Invoice Form
v_entity_name VARCHAR2(50) := 'AP_INVOICES';
v_invoice_id NUMBER;
v_user_id NUMBER := fnd_global.user_id;

begin
/*Set Org Context. Give Org_id accordingly*/
mo_global.set_policy_context('S',&Org_id);

/*Getting Category_id of "FromSupplier".


Change it according to your requirement*/
SELECT category_id into v_category_id
FROM fnd_document_categories
WHERE name = 'FromSupplier';

/*Give appropriate Invoice number*/


SELECT invoice_id into v_invoice_id
FROM ap_invoices_all
WHERE invoice_num = '&Inv_num';

fnd_webattch.add_attachment(
seq_num => 100
,category_id => v_category_id
,document_description => v_description
,datatype_id => 5 --url
,text => NULL
,file_name => NULL
,url => v_invoice_image_url
,function_name => v_function_name
,entity_name => v_entity_name
,pk1_value => v_invoice_id
,pk2_value => NULL
,pk3_value => NULL
,pk4_value => NULL
,pk5_value => NULL
,media_id => NULL
,user_id => v_user_id
Co );
nfi EXCEPTION
de WHEN OTHERS THEN
nti
raise_application_error (-20002, 'An error has occurred inserting
attaching an url to the invoice.');
al -
end;
Ora
cle
Res
tric
ted
Co
nfi
de
nti
al -
Ora Test:
cle Invoice Workbench > View > Attachments
Res
tric
ted

Co
nfi
de
nti
al -
Ora
cle
Res
tric
ted

You might also like