N/render Module

Use the N/render module for printing, PDF creation, form creation from templates, and email creation from templates.

                                   
Note:

Direct manipulation of the print URL is not supported.

In This Help Topic

N/render Module Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Object

render.EmailMergeResult

Object

Server scripts

Encapsulates an email merge result.

render.TemplateRenderer

Object

Server scripts

Encapsulates a template object that produces HTML and PDF printed forms utilizing advanced PDF/HTML template capabilities.

Method

render.bom(options)

file.File

Server scripts

Creates a PDF or HTML file object containing a bill of materials.

render.create()

render.TemplateRenderer

Server scripts

Creates a render.TemplateRenderer object.

render.mergeEmail(options)

render.EmailMergeResult

Server scripts

Creates a render.EmailMergeResult object.

render.packingSlip(options)

file.File

Server scripts

Creates a PDF or HTML file object containing a packing slip.

render.pickingTicket(options)

file.File

Server scripts

Creates a PDF or HTML file object containing a picking ticket.

render.statement(options)

file.File

Server scripts

Creates a PDF or HTML file object containing a statement.

render.transaction(options)

file.File

Server scripts

Creates a PDF or HTML file object containing a transaction.

render.xmlToPdf(options)

file.File

Server scripts

Passes XML to the BFO tag library (which is stored by NetSuite), and returns a PDF file.

Enum

render.DataSource

enum

Server scripts

Holds the string values for supported data source types.

render.PrintMode

enum

Server scripts

Holds the string values for supported print output types.

EmailMergeResult Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

EmailMergeResult.body

string (read-only)

Server scripts

The body of the email distribution in string format.

EmailMergeResult.subject

string (read-only)

Server scripts

The subject of the email distribution in string format.

TemplateRenderer Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Method

TemplateRenderer.addCustomDataSource(options)

void

Server scripts

Adds an XML file or JSON object to an advanced template as a custom data source.

TemplateRenderer.addQuery(options)

void

Server scripts

Uses Query as the renderer's data source.

TemplateRenderer.addRecord(options)

void

Server scripts

Binds a record to a template variable.

TemplateRenderer.addSearchResults(options)

void

Server scripts

Binds a search result to a template variable.

TemplateRenderer.renderAsPdf()

Object

Server scripts

Uses an advanced template to produce a PDF printed form.

TemplateRenderer.renderPdfToResponse()

void

Server scripts

Renders PDF template content as a server response.

TemplateRenderer.renderAsString()

string

Server scripts

Returns template content in string form.

TemplateRenderer.setTemplateById(options)

void

Server scripts

Sets the template using the internal ID.

TemplateRenderer.setTemplateByScriptId(options)

void

Server scripts

Sets the template using the script ID.

TemplateRenderer.renderToResponse(options)

void

Server scripts

Renders HTML template content as a server response.

Property

TemplateRenderer.templateContent

string

Server scripts

Content of the template.

Related Topics

SuiteScript 2.x Modules
SuiteScript 2.x
Scripting with Advanced Templates

General Notices