renderAndUploadTransaction

renderAndUploadTransaction(options)

Method Description

This function allows you render a transaction PDF in NetSuite and upload it to SharePoint

Returns
DirectoryItem

Supported Script Types

SuiteScript 2.1
Server-side Scripts: User Event, Suitelet, RESTlet, Map/Reduce, Scheduled, Workflow Action

Limitations

Record type must be a transaction record

Module

b4cd-file-api-lib.js
See notes on how to load this module: FileSync API for SuiteScript

Since

FileSync 0.5.1

Parameters

Note: The options parameter is a JavaScript object.

ParameterTypeRequiredDescriptionSince
options.recordId
integerrequiredThe internal ID of the record in NetSuite which we are associating the  transaction PDF to. 0.5.1
options.recordTypeConfigId

integer

required 

Internal ID of the FileSync Record Type Configuration record (customrecord_b4cd_record_type_config).

0.5.1

options.formId

integeroptionalThe internal ID of the form, or custom form, for the transaction.0.5.1

Returns 

PropertyTypeDescriptionSince
DirectoryItem.name

string

The file or folder name

0.5.1

DirectoryItem.uniqueId
stringThe unique ID of the file or folder as assigned by the file hosting service. 0.5.1
DirectoryItem.type
stringPossible Values: "file", "folder"0.5.1
DirectoryItem.fileSize
integerFile size in bytes.0.5.1
DirectoryItem.apiUri
stringThe URI used to access the file or folder via the API. 0.5.1
DirectoryItem.filePath
stringThe relative file or folder path on the file hosting service starting from the base directory. 0.5.1
DirectoryItem.uri
stringThe user-navigable URI for the folder or file on the file hosting platform. This can be used to construct hyperlinks for users to reach the file or folder externally. 0.5.1

Errors

Error CodeDetails
MISSING_REQD_ARGUMENT

A required argument is missing or undefined.

Example Usage

var params = {
             recordId: scriptContext.newRecord.id,
             configIds: [35],
             formId: 11
           }
fileapi.renderAndUploadTransaction(params)

Was this article helpful?