' Core SuiteScript Functions '
function nlapiCreateRecord(type) { ; } ' instantiate a new record from the system. '
function nlapiCopyRecord(type, id) { ; } ' instantiate a new record using values from an existing record. '
function nlapiLoadRecord(type, id) { ; } ' load an existing record from the system. '
function nlapiSubmitRecord(record, doSourcing, ignoreMandatoryFields) { ; } ' submit a record to the system for creation or update '
function nlapiDeleteRecord(type, id) { ; } ' delete a record from the system. '
function nlapiSearchRecord(type, id, filters, columns) { ; } ' perform a record search using an existing search or filters and columns '
function nlapiSearchGlobal(keywords) { ; } ' perform a global record search across the system '
function nlapiSearchDuplicate(type, fields, id) { ; } ' perform a duplicate record search using Duplicate Detection criteria. '
function nlapiTransformRecord(type, id, transformType, transformValues) { ; } ' create a new record using values from an existing record of a different type. '
function nlapiLookupField(type,id,fields) { ; } ' fetch the value of a field or set of fields for a record. '
function nlapiSubmitField(type,id,fields,values,doSourcing) { ; } ' submit the values of a field or set of fields for an existing record. '
function nlapiResolveURL(type, identifier, id, editmode) { ; } ' resolve a URL to an object in the system. '
function nlapiSetRedirectURL(type, identifier, id, editmode, parameters) { ; } ' redirect the user to a page. '
function nlapiRequestURL(url, postdata, headers, callback) { ; } ' request a URL to an external or internal resource. '
function nlapiGetContext() { ; } ' return context information about the current user/script. '
function nlapiGetUser() { ; } ' return the internalId for the current user. '
function nlapiGetRole() { ; } ' return the internalId for the current user's role. '
function nlapiGetDepartment() { ; } ' return the internalId for the current user's department. '
function nlapiGetLocation() { ; } ' return the internalId for the current user's location. '
function nlapiGetSubsidiary() { ; } ' return the internalId for the current user's subsidiary. '
function nlapiGetRecordType() { ; } ' return the recordtype corresponding to the current page or userevent script. '
function nlapiGetRecordId() { ; } ' return the internalId corresponding to the current page or userevent script. '
function nlapiSendEmail(from, to, subject, body, cc, bcc, records, files) { ; } ' send out an email and associate it with records in the system. '
function nlapiSendFax(from, to, subject, body, records, files) { ; } ' send out a fax and associate it with records in the system. '
function nlapiGetFieldValue(fldnam) { ; } ' return the value of a field on the current record on a page or userevent/suitelet script. '
function nlapiSetFieldValue(fldnam,value,firefieldchanged,synchronous) { ; } ' set the value of a field on the current record on a page or userevent/suitelet script. '
function nlapiGetLineItemValue(type,fldnam,linenum) { ; } ' return the value of a line item field on the current record on a page or userevent/suitelet script. '
function nlapiSetLineItemValue(type,fldnam,linenum,value) { ; } ' set the value of a line item field on the current record on a page or userevent/suitelet script. '
function nlapiGetLineItemCount(type) { ; } ' return the number of line items in a line item group on the current record on a page or userevent/suitelet script. '
function nlapiInsertLineItem(type, line) { ; } ' insert and select a new line into the line item group on a page or userevent/suitelet script. '
function nlapiRemoveLineItem(type, line) { ; } ' remove the currently selected line from the line item group on a page or userevent/suitelet script. '
' Client SuiteScript Functions '
function nlapiSetFieldText(fldnam,txt,firefieldchanged,synchronous) { ; } ' set the value of a field on the current record on a page using it's label. '
function nlapiGetFieldText(fldnam) { ; } ' return the label of a select field's current selection on the current record on a page. '
function nlapiSetCurrentLineItemValue(type,fldnam,value,firefieldchanged,synchronous) { ; } ' set the value of a field on the currently selected line. '
function nlapiSetCurrentLineItemText(type,fldnam,txt,firefieldchanged,synchronous) { ; } ' set the value of a field on the currently selected line using it's label. '
function nlapiGetCurrentLineItemValue(type,fldnam) { ; } ' return the value of a field on the currently selected line. '
function nlapiGetCurrentLineItemText(type,fldnam) { ; } ' return the label of a select field's current selection on the currently selected line. '
function nlapiGetLineItemText(type,fldnam,linenum) { ; } ' return the label of a select field's current selection for a particular line. '
function nlapiGetCurrentLineItemIndex(type) { ; } ' return the line number for the currently selected line. '
function nlapiDisableField(fldnam,val) { ; } ' disable a field. '
function nlapiDisableLineItemField(type,fldnam,val) { ; } ' disable a field in a line item group. '
function nlapiRefreshLineItems(type) { ; } ' refresh the line item table. '
function nlapiSelectLineItem(type, linenum) { ; } ' select an existing line in a line item group. '
function nlapiCommitLineItem(type) { ; } ' save changes made on the currently selected line to the line item group. '
function nlapiCancelLineItem(type) { ; } ' cancel any changes made on the currently selected line. '
function nlapiSelectNewLineItem(type) { ; } ' select a new line in a line item group. '
function nlapiIsLineItemChanged(type) { ; } ' returns true if any changes have been made to a line item group. '
function nlapiInsertSelectOption(fldnam, value, text, selected) { ; } ' Adds a select option to a scripted select or multiselect field. '
function nlapiRemoveSelectOption(fldnam, value) { ; } ' Removes a select option (or all if value is null) from a scripted select or multiselect field. '
function nlapiInsertLineItemOption(type, fldnam, value, text, selected) { ; } ' Adds a select option to a scripted select or multiselect line item field. '
function nlapiRemoveLineItemOption(type, fldnam, value) { ; } ' Removes a select option (or all if value is null) from a scripted select or multiselect line item field. '
' Server SuiteScript Functions '
function nlapiGetNewRecord() { ; } ' return an record object containing the data being submitted to the system for the currenr record. '
function nlapiGetOldRecord() { ; } ' return an record object containing the current record's data prior to the write operation. '
function nlapiCreateError(code,details,suppressEmail) { ; } ' create an nlobjError object that can be used to abort script execution '
function nlapiCreateForm(title, hideNavBar) { ; } ' return a new form that can be used to build a custom page. '
function nlapiCreateList(title, hideNavBar) { ; } ' return a new list that can be used to build a custom page. '
function nlapiLoadFile(id) { ; } ' load a file from the file cabinet and return the contents as a String (base-64 encoded for binary files). '
function nlapiCreateFile(name, type, contents) { ; } ' instantiate a file object (specifying the name, type, and contents which are base-64 encoded for binary types.) '
function nlapiMergeRecord(id, baseType, baseId, altType, altId, fields) { ; } ' perform a mail merge operation using any template and up to 2 records and returns an nlobjFile with the results. '
function nlapiPrintRecord(type, id, format, properties) { ; } ' print a record (transaction) gievn its type, id, and output format. '
function nlapiLogExecution(type, title, details) { ; } ' create an entry in the script execution log. '
function nlapiScheduleScript(script, deployment, parameters) { ; } ' queue a scheduled script for immediate execution and return the status QUEUED if successfull. '
function nlapiAttachRecord(type1, id1, type2, id2, properties) { ; } ' attach a single record to another with optional properties. '
function nlapiDetachRecord(type1, id1, type2, id2, properties) { ; } ' detach a single record from another with optional properties. '
' Helper SuiteScript Functions '
function nlapiStringToDate(str) { ; } ' convert a String into a Date object. '
function nlapiDateToString(d, formattype) { ; } ' convert a Date object into a String using the current user's date format preference or an optional format type (date|datetime|timeofday). '
function nlapiAddDays(d, days) { ; } ' add days to a Date object. '
function nlapiAddMonths(d, months) { ; } ' add months to a Date object. '
function nlapiFormatCurrency(str) { ; } ' format a number for data entry into a currency field. '
function nlapiEncrypt(s) { ; } ' encrypt a String using an asymetric encryption algorithm. '
function nlapiEscapeXML(text) { ; } ' escape a String for use in an XML document. '
function nlapiStringToXML(text) { ; } ' convert a String into an XML document. '
function nlapiXMLToString(xml) { ; } ' convert an XML document into a String. '
function nlapiSelectValue(node, xpath) { ; } ' select a value from an XML node using Xpath. '
function nlapiSelectValues(node, xpath) { ; } ' select an array of values from an XML node using Xpath. '
function nlapiSelectNode(node, xpath) { ; } ' select a node from an XML node using Xpath. '
function nlapiSelectNodes(node, xpath) { ; } ' select an array of nodes from an XML node using Xpath. '
' nlobjRecord: scriptable record used for accessing and manipulating records. '
function nlobjRecord( ) { ; }
nlobjRecord.getId = function( ) { ; } ' return the internalId of the current record or NULL for new records. '
nlobjRecord.getRecordType = function( ) { ; } ' return the recordType corresponding to this record. '
nlobjRecord.setFieldValue = function( name, value ) { ; } ' set the value of a field. '
nlobjRecord.setFieldValues = function( name, value ) { ; } ' set the values of a multi-select field. '
nlobjRecord.getFieldValue = function( name ) { ; } ' return the value of a field. '
nlobjRecord.getFieldValues = function( name ) { ; } ' return the selected values of a multi-select field as an Array. '
nlobjRecord.getAllFields = function( ) { ; } ' return an Array of all field names on the record. '
nlobjRecord.getAllLineItemFields = function( group ) { ; } ' return an Array of all field names on a record for a particular line item group. '
nlobjRecord.setLineItemValue = function( group, name, line, value ) { ; } ' set the value of a line item field. '
nlobjRecord.getLineItemValue = function( group, name, line ) { ; } ' return the value of a line item field. '
nlobjRecord.getLineItemCount = function( group ) { ; } ' return the number of lines in a line item group. '
nlobjRecord.insertLineItem = function( group, line ) { ; } ' insert a new line into a line item group. '
nlobjRecord.removeLineItem = function( group, line ) { ; } ' remove an existing line from a line item group. '
' nlobjFile: file object. '
function nlobjFile( ) { ; }
nlobjFile.getName = function( ) { ; } ' return the name of the file. '
nlobjFile.getId = function( ) { ; } ' return the id of the file (if stored in the FC). '
nlobjFile.getSize = function( ) { ; } ' return the size of the file. '
nlobjFile.getURL = function( ) { ; } ' return the URL of the file (if stored in the FC). '
nlobjFile.getType = function( ) { ; } ' return the type of the file. '
nlobjFile.getValue = function( ) { ; } ' return the value (base64 encoded for binary types) of the file. '
nlobjFile.setName = function( name ) { ; } ' sets the name of a file. '
' nlobjSearchFilter: filter objects used to define search criteria. '
function nlobjSearchFilter( name, join, operator, value, value2 ) { ; }
nlobjSearchFilter.getName = function( ) { ; } ' return the name of this search filter. '
nlobjSearchFilter.getJoin = function( ) { ; } ' return the join id for this search filter. '
nlobjSearchFilter.getOperator = function( ) { ; } ' return the filter operator used. '
' nlobjSearchColumn: column objects used to define search return columns. '
function nlobjSearchColumn( name, join, summary ) { ; }
nlobjSearchColumn.getName = function( ) { ; } ' return the name of this search column. '
nlobjSearchColumn.getJoin = function( ) { ; } ' return the join id for this search column. '
nlobjSearchColumn.getSummary = function( ) { ; } ' return the summary type (avg,group,sum,count) of this search column. '
nlobjSearchColumn.getAllColumns = function( ) { ; } ' return an array of all nlobjSearchColumn objects returned in this search. '
' nlobjSearchResult: search result row object. '
function nlobjSearchResult( ) { ; }
nlobjSearchResult.getId = function( ) { ; } ' return the internalId for the record returned in this row. '
nlobjSearchResult.getRecordType = function( ) { ; } ' return the recordtype for the record returned in this row. '
nlobjSearchResult.getValue = function( name, join, summary ) { ; } ' return the value of this return column. '
nlobjSearchResult.getText = function( name, join, summary ) { ; } ' return the text value of this return column if it's a select field. '
' nlobjContext: user and script context information. '
function nlobjContext( ) { ; }
nlobjContext.getName = function( ) { ; } ' return the name of the current user. '
nlobjContext.getUser = function( ) { ; } ' return the internalId of the current user. '
nlobjContext.getRole = function( ) { ; } ' return the internalId of the current user's role. '
nlobjContext.getRoleCenter = function( ) { ; } ' return the internalId of the current user's center type. '
nlobjContext.getEmail = function( ) { ; } ' return the email address of the current user. '
nlobjContext.getCompany = function( ) { ; } ' return the account ID of the current user. '
nlobjContext.getDepartment = function( ) { ; } ' return the internalId of the current user's department. '
nlobjContext.getLocation = function( ) { ; } ' return the internalId of the current user's location. '
nlobjContext.getSubsidiary = function( ) { ; } ' return the internalId of the current user's subsidiary. '
nlobjContext.getExecutionContext = function( ) { ; } ' return the internalId of the current user's role. '
nlobjContext.getRemainingUsage = function( ) { ; } ' return the amount of usage units remaining for this script. '
nlobjContext.getSetting = function( type, name ) { ; } ' return a system/script setting. Types are SCRIPT, SESSION, FEATURE, PERMISSION '
nlobjContext.setSetting = function( type, name, value ) { ; } ' set a system/script setting. Only supported type is SESSION '
nlobjContext.getLogLevel = function( ) { ; } ' return the logging level for the current script execution. Not supported in CLIENT scripts '
nlobjContext.getEnvironment = function( ) { ; } ' return the environment that the script is executing in: SANDBOX, PRODUCTION, BETA, INTERNAL '
' nlobjError: system or user-defined error object. '
function nlobjError( ) { ; }
nlobjError.getId = function( ) { ; } ' return the error db ID for this error (if it was an unhandled unexpected error). '
nlobjError.getCode = function( ) { ; } ' return the error code for this system or user-defined error. '
nlobjError.getDetails = function( ) { ; } ' return the error description for this error. '
nlobjError.getStackTrace = function( ) { ; } ' return a stacktrace containing the location of the error. '
nlobjError.getUserEvent = function( ) { ; } ' return the userevent script name where this error was thrown. '
nlobjError.getInternalId = function( ) { ; } ' return the internalid of the record if this error was thrown in an aftersubmit script. '
' nlobjResponse: ServletResponse used in SUITELETs -or- returned by a call to nlapiRequestURL. '
function nlobjResponse( ) { ; }
nlobjResponse.addHeader = function( name, value ) { ; } ' adds a custom response header. '
nlobjResponse.setHeader = function( name, value ) { ; } ' sets a custom response header. '
nlobjResponse.setContentType = function( type, filename ) { ; } ' sets the content type for the response (and an optinal filename for binary output). '
nlobjResponse.sendRedirect = function( category, type, id, editmode, parameters ) { ; } ' sets the redirect URL for the response. '
nlobjResponse.write = function( output ) { ; } ' write information (text/xml/html) to the response. '
nlobjResponse.writeLine = function( output ) { ; } ' write line information (text/xml/html) to the response. '
nlobjResponse.writePage = function( pageobject ) { ; } ' write a page (nlobjForm or nlobjList). '
nlobjResponse.getHeader = function( ) { ; } ' return the value of a header returned via nlapiRequestURL. '
nlobjResponse.getHeaders = function( ) { ; } ' return all the values of a header returned via nlapiRequestURL. '
nlobjResponse.getAllHeaders = function( ) { ; } ' return an Array of all headers returned via nlapiRequestURL. '
nlobjResponse.getCode = function( ) { ; } ' return the response code returned via nlapiRequestURL. '
nlobjResponse.getBody = function( ) { ; } ' return the response body returned via nlapiRequestURL. '
nlobjResponse.getError = function( ) { ; } ' return the nlobjError thrown via a client call to nlapiRequestURL. '
' nlobjRequest: ServletRequest in SUITELETs and available in beforeLoad scripts (for browser requests). '
function nlobjRequest( ) { ; }
nlobjRequest.getParameter = function( name ) { ; } ' return the value of a request parameter. '
nlobjRequest.getParameterValues = function( name ) { ; } ' return the values of a request parameter as an Array. '
nlobjRequest.getAllParameters = function( ) { ; } ' return an Array containing all the request parameters. '
nlobjRequest.getLineItemValue = function( group, name, line ) { ; } ' return the value of a line item value. '
nlobjRequest.getLineItemCount = function( group ) { ; } ' return the number of lines in a line item group. '
nlobjRequest.getHeader = function( name ) { ; } ' return the value of a header. '
nlobjRequest.getAllHeaders = function( ) { ; } ' return an Array containing all the request headers. '
nlobjRequest.getBody = function( ) { ; } ' return the entire body of the request. '
nlobjRequest.getURL = function( ) { ; } ' return the URL being requested. '
nlobjRequest.getMethod = function( ) { ; } ' return the METHOD of the request: GET or POST. '
' nlobjPortlet: scriptable dashboard portlet. '
function nlobjPortlet( ) { ; }
nlobjPortlet.setTitle = function( title ) { ; } ' set the portlet title. '
nlobjPortlet.setHtml = function( html ) { ; } ' set the entire contents of the HTML portlet (will be placed inside a