|
type: the recordType for the record
id: the internal id for the record
|
Initializes a new record using field data from an existing record and returns an nlobjRecord.
|
||||||||||
|
Instantiates an nlobjError object with a user-defined error code and description
|
|||||||||||
|
Initializes a new record and returns an nlobjRecord containing all the default field data for that record type.
|
|||||||||||
|
type: record type for the record
|
Deletes and commits new records or changes applied to an existing record and returns the internalId for the committed record.
Deletes a scriptable record from the database.
|
||||||||||
|
nlobjContext object: returns context information (metadata) about current user and script execution
|
Use to branch scripts depending on the metadata. For example, you may want the script to perform in one way when a form is accessed via the UI and another when the form is accessed via Web services.
|
||||||||||
|
Returns the internalId for the current user’s department
|
|||||||||||
|
fldnam: String - the name of the value whose field is being returned
|
Returns the value of a field on the current record
|
nlapiGetFieldValue is available only in Client and User Event SuiteScripts.
|
|||||||||
|
type: String - the name of the line item group
|
Returns the number of lines in a group for the current record
|
nlapiGetLineItemCount is available only in Client and User Event SuiteScripts.
|
|||||||||
|
type: String - the name of the line item group
fldnam: String - the name of the fields whose value is being returned
linenum: Integer - the line number for this field (1-based)
|
Returns the value of a line item field
|
nlapiGetLineItemValue is available only in Client and User Event SuiteScripts.
Note: You cannot set default line item values when the line is not in edit mode.
|
|||||||||
|
Returns the internalId for the current user's location
|
|||||||||||
|
Returns the internalId for the record whose form the user is currently on, or for the record that the current user event script is executing on.
|
Use to retrieve the internalId of the current record in a User Event script.
Note: This API is only available to Client and User Event SuiteScripts.
|
||||||||||
|
Returns the recordType for the record whose form the user is currently on, or for the record that the current User Event script is executing on.
|
Use to retrieve the record type of the current record in a User Event SuiteScript.
Note: This API is only available to Client and User Event SuiteScripts.
|
||||||||||
|
Returns the internalId for the current user's role
|
|||||||||||
|
type: the name of the line item group
line: the line number in which to insert new line (only valid for User Event scripts)
|
Inserts a line above the currently selected line in a sublist
Note: This API is only available to Client and User Event scripts
|
||||||||||
|
Returns the internalId for the current user
|
|||||||||||
|
type: record type for the record
|
Reads an existing record from the system and returns an nlobjRecord containing all the field data for that record.
|
||||||||||
|
type: sets the recordType to perform a field lookup on
id: the internalid for the record
fields: set an array of column/field names to look up, or a single column/field name
text: returns the display name for this field (valid only for SELECT fields)
|
Returns a single value (or text) or an associative Array of fieldname -> value (or text) pairs depending on the fields argument
|
Convenient helper function used to perform searches for field(s) on a records.
|
|||||||||
|
type: the name of the line item group
line: the line number in which to insert new line (only valid for User Event scripts)
|
Remove the currently selected line in a sublist
Note: This API is only available to Client and User Event scripts
|
||||||||||
|
url: String (fully qualified unless NetSuite page)
postdata: postdata used for a POST request. It can either be an associative array of form parameters or a String. If null, then a GET request is used
headers: Custom HTTP headers to be included in the request
callback: a callback function called when request is completed (Client SuiteScript only)
target: target window where request should be made (Client SuiteScript only)
|
response: nlobjResponse that contains the response
|
Requests an HTTP(s) URL (internal or external).
|
|||||||||
|
type: recordtype or tasklink intenalId
identifier: The primary id for this resource (recordType for RECORD)
id: the secondary id for this resource (recordId for RECORD)
editmode: for RECORD calls, this determines whether to return a URL for the record in EDIT mode or VIEW mode
|
Return the URL to an internal NetSuite resource
|
Note: Using a user-defined scriptId to reference custom records and lists, saved searches, and scripts is not currently supported.
|
|||||||||
|
id: the internalId for the saved search
filters: an array of nlobjSearchFilter objects or a single nlobjSearchFilter
columns: an array of nlobjSearchColumn objects or a single nlobjSearchColumn
|
nlobjSearchResult[] : An array of nlapiSearchResult objects
|
Performs a search using a set of criteria and columns or alternatively using an existing saved search.
|
|||||||||
|
author: the internalId of an employee record (this is the sender) Must be an employee record and defaults to script deployer ID)
recipient: recipient internalID or external email address
subject: subject of the outgoing mail
body: body of the outgoing email. Note: The body argument is required. A JavaScript exception will be thrown if the body of the email message is left blank.
cc[ ] : an array of email addresses or a single email address to copy
bcc[ ]: array of email addresses or a single email address to blind copy
records: An associative array of internal records to associate this email with. The following options are valid:
|
Note: You can use NetSuite email templates to construct the body of the email using nlapiMergeEmail, which performs a merge operation using a NetSuite email template and up to two business records.
|
||||||||||
|
fldnm: String - the name of the field being set
value: String - the value the field is being set to
firefieldchanged: Boolen - if true then the fieldchange script for that field is executed. (Only available in Client SuiteScript)
|
This API can be used during beforeLoad scripts to initialize field scripts on new records or non-stored fields.
nlapiSetFieldValue is available only in Client and User Event SuiteScripts.
|
||||||||||
|
type: String - the name of the line item group
fldnam: String - the name of the field being set
linenum: Integer - the line number for this field (1-based)
value: String - the value the field is being set to
|
Sets the value of a line item field on the current record
nlapiSetLineItemValue can be used during beforeLoad scripts to initialize line items on new records.
nlapiSetLineItemValue is available only in Client and User Event SuiteScripts.
|
||||||||||
|
type: recordtype or tasklink id
identifier: The primary id for this resource (recordType for RECORD)
id: The secondary id for this resource (recordId for RECORD,)
editmode: if TRUE, returns the URL to an existing record in EDIT mode
parameters: An associative array of additional URL parameters - (All parameters must be prefixed with custparam)
|
Sets the redirect URL or redirects user directly (for user event load script). You can only redirect to pages within NetSuite.
Note: All parameters must be prefixed with custparam otherwise an SSS_INVALID_ARG error will be thrown.
Note: Using a user-defined scriptId to reference custom records and lists, saved searches, and scripts is not currently supported.
|
||||||||||
|
doSourcing: if TRUE, enables automatic field sourcing
|
Submits and commits new records or changes applied to an existing record and returns the internalId for the committed record.
|
||||||||||
|
type: the record type for the existing record
transformType: the record type you are transforming the existing record into
transformValues: an array of fieldname-> value pairs containing field defaults used for transformation
|
Initializes a new record using data from an existing record of a different type and returns an nlobjRecord.
|
|
type: String - the name of the line item group
|
Cancels any uncommited changes to the current line of a sublist
|
||
|
type: String - the name of the line item group
|
Saves/commits the changes to the current line in a line item group on a sublist.
This is the equivalent of clicking Done for a line item in the UI.
|
||
|
fldnam: String - the name of the field to enable/disable
val: Boolean - if ‘T’ then the field is disabled, otherwise it is enabled
|
Sets the given field to disabled or enabled based on the value (true or false).
|
||
|
type: String - the name of the line item group
fldnam: String - the name of the field to enable/disable
val: Boolen - if ‘T’ then the field is disabled, otherwise it is enabled
|
Sets the given line item field of the given type to disabled or enabled based on the value (true or false).
|
||
|
type: String - the name of the line item group
|
Returns the line number of the currently selected line in a group
|
Retrieves the current index of the line being added or edited.
|
|
|
type: String - the name of the line item group
fldnam: String - the name of the field being set
linenum - the line number for this field (sublists only)
|
Returns the display name of a select field (based on its current selection) on the currently selected line
|
Gets the text value of the given line-item selection field in the form before it has been added. Typically used in validate line functions.
|
|
|
type: String - the name of the line item group
fldnam: String - the name of the field being set
linenum - the line number for this field (sublists only)
|
Returns the value of a field on the currently selected line
|
Retrieves the value of the given line-item field before it has been added to the form. Typically used in validate line functions.
|
|
|
fldnam: String - the name of the field being set
|
Returns the display name for a select field corresponding to the current selection
|
Important: nlapiGetFieldText can NOT be used on hidden fields.
|
|
|
type: String - the name of the line item group
fldnam: String - the name of the field being set
linenum: Integer - the line number for this field (1-based)
|
Returns the display name of a select field (based on it's current selection) in a line item group
|
Gets the text value of the given selection field on the line item at the given index.
|
|
|
fldnam: the name of the scripted field
value: the value of the select option (should be unique)
text: the display name of the select option
selected: True if this option should become the default option
|
Adds a select option to a select/multiselect field added via script
|
||
|
type: String - the name of the line item group
|
Returns true if the currently selected line of the sublist has been edited
|
Determines whether any changes have been made to a line item group
|
|
|
type: String - the name of the line item group
|
Redraws a line item group to reflect recent changes to the underlying data
|
||
|
fldnam: the name of the scripted field
value: the value of the select option to be removed or null to delete all the options
|
Removes a single select option from a select or multiselect field added via script
|
||
|
type: String - the name of the line item group
linenum: String - the line number to select
|
Selects an existing line in a sublist line item group.
|
||
|
type: the name of the line item group
|
|||
|
type: String - the name of the line item group
fldnam: String - the name of the field being set
text: String - the display name associated with the value that the field is being set to
firefieldchanged: if true, then field changed scripts for that field are executed
|
Sets the value of a select field on the currently selected line using the display name
|
||
|
type: String - the name of the line item group
fldnam: String - the name of the field being set
value: String - the value the field is being set to
firefieldchanged: Boolean - if true then fieldchanged scripts for that field are executed
|
Sets the value of the given line-item field before it has been added to the form. Typically used in validate line functions.
|
||
|
fldname: String - the name of the field being set
txt: String - the display name associated with the value that the field is being set to
firefieldchanged: Boolean - if true, then fieldchanged scripts for that field are executed
|
Sets the value of a select field on the current record using the display name
|
|
Returns an nlobjRecord containing all the values being used for a write operation
|
Available in beforeSubmit and afterSubmit SuiteScript User Event scripts only.
|
||||||||||||||
|
Returns an nlobjRecord containing all the values for the current record prior to the write operation
|
Available in beforeSubmit and afterSubmit SuiteScript User Event scripts only.
|
||||||||||||||
|
type: log type ( audit, debug, error, emergency)
title: a title used to organize log entries (max length: 99 characters)
details: details of the log entry (max length: 3000 characters)
|
Logs a message, audit, or note against a SuiteScript script deployment.
|
||||||||||||||
|
id: The internalId of the email template
baseType: The recordType for the primary record used in the merge
baseId: The internalId for the primary record used in the merge
altType: The recordType for the secondary record used in the merge
altId: The internalId for the secondary record used in the merge
|
Returns a String containing the results
|
Note: With nlapiSendEmail you can use NetSuite email templates to construct the body of the email using nlapiMergeEmail.
nlapiMergeEmail performs a merge operation using a NetSuite email template and up to two business records.
|
|||||||||||||
|
deployment: the deployment internalId
parameters: optional third argument. An associative array of parameter values used to override the script parameter values for this execution
|
Returns a String whose value is QUEUED if the script was successfully queued by this call, or it returns the script's current status or null (if the script is undeployed or invalid)
|
Schedules a long-running script for immediate execution if its current status is Scheduled or Not Scheduled.
|
|
Encapsulates user information and execution context
|
||||||||||
|
user entity internalID
|
||||||||||
|
user role internalID
|
||||||||||
|
user company internalID
|
||||||||||
|
user email address
|
||||||||||
|
execution context: user interface, web services, offlineclient, smbxml
|
||||||||||
|
Returns the remaining number of units for the current script
|
||||||||||
|
type: the type of script/system setting:
name: the name of the script/system setting
|
Returns a system or script setting. (Only available in Server SuiteScript.)
|
|||||||||
|
setSetting ( type, name, value )
type: the type of script/system setting:
name: the name of the script/system setting
value: the new value for the script/system setting
|
Returns a system or script setting. (Only available in Server SuiteScript.)
|
|||||||||
|
Primary object used to encapsulate errors in the system
|
Returns the error code (user-defined or system) associated with this error
|
|||||||||
|
Returns the error message (user-defined or system) associated with this error
|
||||||||||
|
Returns the stack trace associated with this error
|
||||||||||
|
Returns the internalId of the submitted record if this error was thrown in an after-submit script
|
||||||||||
|
Returns the name of the User Event script (if applicable) that the error was thrown from
|
||||||||||
|
Primary object used to encapsulate records in the system
|
Returns the record type
|
|||||||||
|
Returns the record intrenalId
|
||||||||||
|
name: the name of the field being set
value: the value of the field being set to (String)
|
Returns the field value
|
|||||||||
|
setFieldValues( name, values )
name: the name of the field being set
values: the value the field is being set to (Array)
|
Returns an array of field values (only applicable for multiselects)
|
Sets the value of a multiselect field
|
||||||||
|
name: the value the field is being set to (Array)
|
Returns the value of a field
|
|||||||||
|
name: the name of the multi-select field whose value is being returned
|
Returns an array of field values (only applicable for multiselects)
|
|||||||||
|
setLineItemValue( group, name, linenum, value )
group: the name of the line item group
name: the name of the field being set
linenum: the line number for this field (1-based)
value: the value the field is being set to
|
The group argument refers to the type of sublist being referenced. For a list of field name values for each group argument, refer to the SuiteScript Reference Guide.
|
|||||||||
|
getLineItemValue( group, name, linenum )
group: the name of the line item group
name: the name of the field whose value is being returned
linenum: the line number for this field (1-based)
|
Returns the value of a line item field
|
The group argument refers to the type of sublist being referenced. For a list of field name values for each group argument, refer to Server SuiteScript Reference Guide.
|
||||||||
|
group: the name of the line item group
|
Returns the number of lines in a machine
|
The group argument refers to the type of sublist being referenced.
The first line number on a machine is 1 (NOT 0).
|
||||||||
|
Returns an associative array of all the changed fields in this record and their values
|
This method does not return ALL fields on a record. This method returns only the fields that have been changed.
|
|||||||||
|
insertLineItem ( group, linenum )
group: the name of the line item group
linenum: the line number for this field (1-based)
|
Inserts a new line into a lineitem group
|
|||||||||
|
removeLineItem ( group, linenum )
group: the name of the line item group
linenum: the line number for this field (1-based)
|
Removes an existing new line from a line item group
|
|||||||||
|
Primary object used to encapsulate an HTTP GET or POST request
|
Return an array of all the header names in the request
|
|||||||||
|
Return an array of all the parameter field names in the request
|
||||||||||
|
Return the body of the request as a String
|
||||||||||
|
name: the name of the header
|
Return the value of a header in the request
|
|||||||||
|
group: the name of the line item group
|
Return the number of lines in a line item group
|
|||||||||
|
getLineItemValue( group, name, line )
group: the name of the line group
name: the name of the field whose value is returned
|
Return the value of a line item
|
|||||||||
|
Return the request type
|
||||||||||
|
name: the name of the request parameter whose value is returned
|
Return the request parameter value for a parameter
|
|||||||||
|
getParameterValues( name )
name: the name of the request parameter whose value is returned
|
Return the request parameter values as an Array for a parameter
|
|||||||||
|
Return the full URL of the request
|
||||||||||
|
Primary object used to encapsulate a server response
|
Return an Array containing all the headers returned by the server
|
Only available in return value of call to nlapiRequestURL
|
||||||||
|
Return the body returned by the server
|
Only available in return value of call to nlapiRequestURL
|
|||||||||
|
Return the HTTP response code returned by the server
|
Only available in return value of call to nlapiRequestURL
|
|||||||||
|
Return the nlobjError thrown during request
|
Only available in return value of call to nlapiRequestURL in Client Public.SuiteScript
|
|||||||||
|
Return the value for a header returned by the server
|
Only available in return value of call to nlapiRequestURL
|
|||||||||
|
name: the name of the header
value: the value used to set the header
|
Sets the value of a response header.
Note: All user-defined headers must be prefixed with "Custom-Header" otherwise an SSS_INVALID_ARG error will be thrown.
|
|||||||||
|
setRedirectURL( type, identifier, ID, editmode, parameters)
type: the base type for this resource
ID: the secondary id for this resource (recordId for RECORD,)
editmode: for RECORD calls, this determines whether to return a URL for the record in EDIT mode vs. VIEW mode
parameters: an associative array of additional URL parameters - (All parameters must be prefixed with custparam)
|
Sets the redirect URL for this request.
Note: All parameters must be prefixed with custparam otherwise an SSS_INVALID_ARG error will be thrown.
Note: Using a user-defined scriptId to reference custom records and lists, saved searches, and scripts is not currently supported.
|
|||||||||
|
output: String or Document being written
|
Writes a String or Document to the response output
|
|||||||||
|
object: standalone page object: nlobjForm or nlobjList
|
Generates a page using a page element object (nlobjForm or nlobjList)
|
|||||||||
|
Primary object used to encapsulate search return columns
|
name: the search return column name
join: the join id for this search return column
|
Constructor used to create a search return column
|
||||||||
|
Returns the name for this search column
|
||||||||||
|
Returns the join id for this search column
|
||||||||||
|
Returns the summary type for this search column
|
||||||||||
|
Primary object used to encapsulate search filters
|
constructor( name, join, operator, value1, value2 )
name: the search filter name for this recordType
join: the join id used for this search field
value1: a filter value -or- special date field value -or- Array of values for select/multiselect fields - (The value1 argument is optional, depending on which operator was used.)
value2: a secondary filter value -or- special date field value for between/within style operators * lastbusinessweek - (The value2 argument is optional, depending on which operator was used. See the SuiteScript Reference Guide for a list of possible operators. )
|
When searching on checkbox fields, use the is operator with a T or F value to search for checked or unchecked fields, respectively.
|
||||||||
|
Returns the name for this search filter
|
||||||||||
|
Returns the join id for this search filter
|
||||||||||
|
Returns the operator for this search filter
|
||||||||||
|
Primary object used to encapsulate a search result row
|
||||||||||
|
getText( name, join, summary )
name: the name of the search column
join: the join internalId for this search column
summary: the summary type used for this search column:
|
Returns the display name for this column (valid for non-stored select fields only)
|
|||||||||
|
getValue( name, join, summary )
name: the name of the search column
join: the join internalId for this search column
summary. the summary type used for this search column:
|
Returns the value for this column
|