I have created the following to attach a EDM file to an email, but I am getting this error in app messages:
CURSOR get_inv
Is
SELECT po_ref_number, invoice_id, company, invoice_no
, ifsapp.purchase_order_cfp.Get_Cf$_Buyer_Name(ifsapp.purchase_order_cfp.Get_Objkey(ifsapp.man_supp_invoice_api.Get_Purchase_Order_Ref_Number(company,invoice_id))) Buyers_name
, ifsapp.purchase_order_api.Get_Buyer_Code(po_ref_number) Buyers_code
, dr.doc_class, dr.doc_no, dr.doc_rev, dr.doc_sheet
FROM ifsapp.POSTING_PROPOSAL_INV_OVERVIEW pp Inner Join ifsapp.doc_reference_object dr On dr.Lu_Name='ManSuppInvoice' and dr.key_ref = 'COMPANY='||company||'^INVOICE_ID='||invoice_id||'^'
where message_id='No Arrival' and po_ref_number='C775261';
BEGIN
For rec in get_inv loop
ifsapp.EDM_FILE_API.REFERENCE_EXIST(f_ ,rec.doc_class, rec.doc_no, rec.doc_sheet ,rec.doc_rev ,'VIEW');
IF f_ = 'TRUE' THEN
doc_type_ := 'VIEW';
ELSE
doc_type_ := 'ORIGINAL';
END IF;
file_name_ := ifsapp.EDM_FILE_API.GET_NEW_LOCAL_FILE_NAME(rec.doc_class, rec.doc_no, rec.doc_sheet ,rec.doc_rev, doc_type_, '1');
ifsapp.command_sys.mail(sender_ => 'IFSAPP'
,from_ => 'IFSAPP'
,to_list_ => email_addr_
,cc_list_ => ''
,bcc_list_ => ''
,subject_ => 'No Arrivals for PO: ' || rec.po_ref_Number || ', Invoice: ' || rec.invoice_no
,text_ => 'The following invoice/s have been received and the receipts have not yet been received. Please receipt in so the invoices can be matched.' || chr(13) ||
'Regards Accounts Payable'
,attach_ => file_name_);