Global API
...
Requests
Upload File

Attach File to Transaction

4min

NetSuite API does not support attaching a file directly to the transaction, so we need minor customizations in NetSuite and Salesforce to attach the file to a transaction.

In NetSuite:

Create a custom field of type document on the transaction to which you want to attach the file.

Document image


In Salesforce:

Once you create the custom field in NetSuite, visit the Breadwinner tab, go to the custom fields section, and click "Fetch custom fields." You can see the created custom field here with the checkbox disabled.

Do the following steps:

  • Create the field of type text manually in Salesforce with the API name shown in the custom fields section, i.e., for example. If your NetSuite API name is custbody44, you must give the salesforce API name as ncf_body44__c. Refer to the sample screenshot attached below.
Document image

  • After creating the field in Salesforce, give the required permissions at the profile level.
  • To cross-check whether the field is created correctly, visit the custom fields section. The disabled checkbox should be checked.
  • To link the document to this field, pass the internal id of the file to that custom field using the update action in Global API.

The following is an example of updating the Sales Order by passing the file's internal id to the custom field.

Apex