Skip to content

CID Software Solutions LTD

Home » Visual Builder Extension for Fusion SaaS: upload an attachment without existing REST API endpoint

Visual Builder Extension for Fusion SaaS: upload an attachment without existing REST API endpoint

General

Oracle Visual Builder Studio has a pre-configured backends for REST API available in Fusion Apps.
Not all business entities that allow attachment management in UI of Fusion Apps expose REST APIs for attachment management.
This post will show how to overcome this obstacle by utilizing SOAP ErpObjectAttachmentService, Application Composer, Groovy and Oracle Integration Cloud.

Use Case

Upload an attachment for Payables Check.
The existing REST APIs for Payable Payments are listed in the official documentation and do not have attachments.

High Level Implementation Details

  1. Create an OIC REST integration that will expose ErpObjectAttachmentService available in Cloud ERP adapter as REST call.
  2. Enhance the REST Utility described here by adding a new externally callable groovy method.
  3. Use FUN_ERP_ATTACHMENT_CONTEXTS to convert PK values used in FND_ATTACHED_DOCUMENTS to user keys acceptable by ErpObjectAttachmentService.
  4. Use standard REST call in Visual Builder to upload the attachment

Detailed Implementation Details

  1. Create an OIC Integration with following JSON payloads for request and response:
    Request:
    {
    “entityName” : “AP_CHECKS_ALL”,
    “categoryName” : “PAYMENT_SUPPORTING_DOC”,
    “UserKeyA” : “35”,
    “UserKeyB” : “#NULL”,
    “UserKeyC” : “#NULL”,
    “UserKeyD” : “#NULL”,
    “UserKeyE” : “#NULL”,
    “Title” : “attach.txt”,
    “Content” : “SGVsbG8gV29ybGQ=”
    }

    Response:
    {
    “result” : “Attachment1: SUCCEEDED”,
    “success” : true
    }

  2. Add a new externally callable groovy method:
  3. To calculate the conversion between keys in FND_ATTACHED_DOCUMENTS and ErpObjectAttachmentService – use the query below than can be achieved by our free tool.
  4. Use standard REST call to call previously exposed groovy method: