This topic maps SuiteScript 1.0 Functions (prefixed with “nlapi”) to their corresponding SuiteScript 2.x APIs. All functions are listed alphabetically in one table.
SuiteScript 1.0 API |
SuiteScript 2.x API |
SuiteScript 2.x Module |
Notes |
---|---|---|---|
nlapiAddDays(d, days) |
See Notes |
See Notes |
This API does not have a SuiteScript 2.x equivalent. Use the following JavaScript to add or subtract days from a Date object: dateObj.setDate(dateObj.getDate() + or – days) For example: Note
SuiteScript 2.x is also compatible with third-party JavaScript APIs that provide this functionality. For information about using third-party APIs with SuiteScript 2.x, see SuiteScript 2.x Custom Modules. |
nlapiAddMonths(d, months) |
See Notes |
See Notes |
This API does not have a SuiteScript 2.x equivalent. Use the following JavaScript to add or subtract months from a Date object: dateObj.setMonth(dateObj.getMonth() + or – months) For example: Note
SuiteScript 2.x is also compatible with third-party JavaScript APIs that provide this functionality. For information about using third-party APIs with SuiteScript 2.x, see SuiteScript 2.x Custom Modules. |
nlapiAttachRecord(type, id, type2, id2, attributes) |
|||
nlapiCancelLineItem(type) |
— |
||
nlapi |
— |
||
nlapiCommitLineItem(type) |
For N/record script samples, see: |
||
nlapiCopyRecord(type, id, initializeValues) |
|||
nlapiCreateAssistant(title, hideHeader) |
— |
||
nlapiCreateCSVImport() |
For script samples, see N/task Module. |
||
nlapi |
Note that scripting subrecords in SuiteScript 2.x is fundamentally different from scripting subrecords in SuiteScript 1.0. For additional information, see the SuiteScript 2.x topics under SuiteScript 2.x Scripting Subrecords. |
||
nlapiCreateEmailMerger |
— |
||
nlapiCreateError(code, details, suppressNotification) |
For a script sample, see N/error Module Script Samples. |
||
nlapiCreateFile(name, type, contents) |
For a script sample, see N/file Module Script Samples. |
||
nlapiCreateForm(title, hideNavbar) |
For a script sample, see N/ui/serverWidget Module Script Samples |
||
nlapiCreateList(title, hideNavbar) |
— |
||
nlapiCreateRecord(type, initializeValues) |
— |
||
nlapiCreateSearch(type, filters, columns) |
For a script sample, see N/search Module Script Samples. |
||
nlapiCreateSubrecord |
Note that scripting subrecords in SuiteScript 2.x is fundamentally different from scripting subrecords in SuiteScript 1.0. For additional information, see the SuiteScript 2.x topics under SuiteScript 2.x Scripting Subrecords. |
||
nlapi |
For a script sample, see N/render Module Script Sample. |
||
nlapiDateToString(d, format) |
For a script sample, see N/format Module Script Samples |
||
nlapiDeleteFile(id) |
— |
||
nlapiDeleteRecord(type, id) |
— |
||
nlapiDetachRecord(type, id, type2, id2, attributes) |
— |
||
nlapiDisableField(fldnam, val) |
Note that |
||
nlapi |
Note that |
||
nlapi |
Note that scripting subrecords in SuiteScript 2.x is fundamentally different from scripting subrecords in SuiteScript 1.0. For additional information, see the SuiteScript 2.x topics under SuiteScript 2.x Scripting Subrecords. |
||
nlapiEditSubrecord |
Note that scripting subrecords in SuiteScript 2.x is fundamentally different from scripting subrecords in SuiteScript 1.0. For additional information, see the SuiteScript 2.x topics under SuiteScript 2.x Scripting Subrecords. |
||
nlapiEncrypt(s, algorithm, key) |
See Notes |
See Notes |
For SuiteScript 2.x encryption, hashing, and HMAC functionality, see the N/crypto Module module. For SuiteScript 2.x encoding functionality, see the N/encode Module module. |
nlapiEscapeXML(text) |
— |
||
nlapiExchangeRate |
For a script sample, see N/currency Module Script Samples. |
||
nlapi |
— |
||
nlapiFindLineItemValue |
— |
||
nlapiFormatCurrency(str) |
Note that SuiteScript 2.x currency formatting is handled by the For a script sample, see N/format Module Script Samples |
||
nlapiGetContext() |
For a script sample, see N/runtime Module Script Samples. |
||
nlapi |
See Notes |
Use the |
|
nlapi |
— |
||
nlapi |
— |
||
nlapi |
— |
||
nlapi |
— |
||
nlapi |
— |
||
nlapiGetDateTimeValue |
See Notes |
Use the |
|
nlapiGetDepartment() |
— |
||
nlapiGetField(fldnam) |
— |
||
nlapiGetFieldText(fldnam) |
— |
||
nlapiGetFieldTexts(fldnam) |
— |
||
nlapiGetFieldValue(fldnam) |
— |
||
nlapiGetFieldValues |
— |
||
nlapiGetJobManager |
For a script sample, see N/task Module. |
||
nlapiGetLineItemCount |
— |
||
nlapi |
See Notes |
Use the |
|
nlapiGetLineItemField(type, fldnamm, linenum) |
SuiteScript 2.x begins sublist numbering with 0. SuiteScript 1.0 begins sublist numbering with 1. |
||
nlapi |
SuiteScript 2.x begins sublist numbering with 0. SuiteScript 1.0 begins sublist numbering with 1. |
||
nlapi |
SuiteScript 2.x begins sublist numbering with 0. SuiteScript 1.0 begins sublist numbering with 1. |
||
nlapiGetLineItemText(type, fldnam, linenum) |
SuiteScript 2.x begins sublist numbering with 0. SuiteScript 1.0 begins sublist numbering with 1. |
||
nlapiGetLineItemValue(type, fldnam, linenum) |
SuiteScript 2.x begins sublist numbering with 0. SuiteScript 1.0 begins sublist numbering with 1. |
||
nlapiGetLineItemValues |
Method returns an array for multi-select fields. SuiteScript 2.x begins sublist numbering with 0. SuiteScript 1.0 begins sublist numbering with 1. |
||
nlapiGetLocation() |
Note that |
||
nlapiGetLogin() |
For a script sample, see N/auth Module Script Sample. |
||
nlapiGetMatrixCount(type, fldnam) |
— |
||
nlapiGetMatrixField(type, fldnam, column) |
— |
||
nlapiGetMatrixValue(type, fldnam, column) |
— |
||
nlapiGetNewRecord() |
See Notes |
See Notes |
To mimic this functionality in SuiteScript 2.x, use the following code in a beforeLoad(context), beforeSubmit(context), or afterSubmit(context) user event script. For additional information and a full script sample, see SuiteScript 2.x User Event Script Type |
nlapiGetOldRecord() |
See Notes |
See Notes |
To mimic this functionality in SuiteScript 2.x, use the following code in a beforeSubmit(context) or afterSubmit(context) user event script. For additional information and a full script sample, see SuiteScript 2.x User Event Script Type |
nlapiGetRecordId() |
— |
||
nlapiGetRecordType() |
To get the current record type in a client script, use To get the current record type in a server script, use |
||
nlapiGetRole() |
— |
||
nlapiGetSubsidiary() |
— |
||
nlapiGetUser() |
— |
||
nlapiInitiateWorkflow |
For a script sample, see N/workflow Module Script Sample. |
||
nlapi |
— |
||
nlapiInsertLineItem(type, line) |
— |
||
nlapi |
— |
||
nlapiInsertSelectOption |
— |
||
nlapiIsLineItemChanged |
Note that |
||
nlapiLoadConfiguration |
For a script sample, see N/config Module Script Sample. |
||
nlapiLoadFile(id) |
For a script sample, see N/file Module Script Samples. |
||
nlapiLoadRecord(type, id, initializeValues) |
— |
||
nlapiLoadSearch(type, id) |
For a script sample, see N/search Module Script Samples. |
||
nlapiLogExecution(type, title, details) |
For a script sample, see N/log Module Script Sample. |
||
nlapiLookupField(type, id, fields, text) |
— |
||
nlapiOutboundSSO(id) |
|
For a script sample, see N/sso Module Script Samples. |
|
nlapiPrintRecord(type, id, mode, properties) |
For a script sample, see N/render Module Script Sample. |
||
nlapiRefreshLineItems |
— |
— |
This API does not have a SuiteScript 2.x equivalent. |
nlapiRefreshPortlet() |
For a script sample, see N/portlet Module Script Sample |
||
nlapi |
Note that scripting subrecords in SuiteScript 2.x is fundamentally different from scripting subrecords in SuiteScript 1.0. For additional information, see the SuiteScript 2.0 topics under SuiteScript 2.x Scripting Subrecords. |
||
nlapiRemoveLineItem(type, line) |
— |
||
nlapi |
— |
||
nlapi |
— |
||
nlapiRemoveSubrecord |
Note that scripting subrecords in SuiteScript 2.x is fundamentally different from scripting subrecords in SuiteScript 1.0. For additional information, see the SuiteScript 2.x topics under SuiteScript 2.x Scripting Subrecords. |
||
nlapiRequestURL(url, postdata, headers, callback, httpMethod) |
— |
||
nlapi |
Server scripts only |
||
nlapiResizePortlet() |
For a script sample, see N/portlet Module Script Sample |
||
nlapiResolveURL(type, identifier, id, displayMode) |
For a script sample, see N/url Module Script Samples. |
||
nlapiScheduleScript(scriptId, deployId, params) |
|||
nlapiSearchDuplicate(type, fields, id) |
— |
||
nlapiSearchGlobal |
— |
||
nlapiSearchRecord(type, id, filters, columns) |
For a script sample, see N/search Module Script Samples. |
||
nlapiSelectLineItem(type, linenum) |
SuiteScript 2.x begins sublist numbering with 0. SuiteScript 1.0 begins sublist numbering with 1. |
||
nlapiSelectNewLineItem |
— |
||
nlapiSelectNode(node, xpath) |
— |
||
nlapiSelectNodes(node, xpath) |
— |
||
nlapiSelectValue(node, xpath) |
See Notes |
To mimic this functionality in SuiteScript 2.x, select a node with XPath.select(options) and then inspect the Node.textContent property. |
|
nlapiSelectValues(node, path) |
See Notes |
To mimic this functionality in SuiteScript 2.x, select an array of nodes with XPath.select(options) and then loop through each node’s Node.textContent property. |
|
nlapi |
— |
||
nlapiSendEmail(author, recipient, subject, body, cc, bcc, records, attachments) |
For a script sample, see N/email Module Script Sample. |
||
nlapiSendFax(author, recipient, subject, body, records, attachments) |
— |
— |
This API does not have a SuiteScript 2.x equivalent. |
nlapi |
See Notes |
Use the |
|
nlapi |
— |
||
nlapi |
— |
||
nlapi |
— |
||
nlapi |
— |
||
nlapiSetDateTimeValue |
See Notes |
Use the |
|
nlapiSetFieldText(fldname, txt, firefieldchanged, synchronous) |
— |
||
nlapiSetFieldTexts (fldname, txts, firefieldchanged, synchronous) |
— |
||
nlapiSetFieldValue(fldnam, value, firefieldchanged, synchronous) |
— |
||
nlapiSetFieldValues (fldnam, value, firefieldchanged, synchronous) |
— |
||
nlapi |
See Notes |
Use the |
|
nlapiSetLineItemValue(type, fldnam, linenum, value) |
SuiteScript 2.x begins sublist numbering with 0. SuiteScript 1.0 begins sublist numbering with 1. |
||
nlapiSetMatrixValue(type, fldnam, column, value, firefieldchanged, synchronous) |
— |
||
nlapiSetRecoveryPoint() |
See Notes |
See Notes |
The SuiteScript 2.x Map/Reduce Script Type automatically incorporates yielding. |
nlapiSetRedirectURL(type, identifier, id, editmode, parameters) |
For a script sample, see N/redirect Module Script Sample. |
||
nlapiStringToDate(str, format) |
For a script sample, see N/format Module Script Samples. |
||
nlapiStringToXML(text) |
— |
||
nlapi |
— |
||
nlapiSubmitCSVImport |
— |
— |
|
nlapiSubmitRecord(record, doSourcing, ignoreMandatoryFields) |
— |
||
nlapiSubmitField(type, id, fields, values, doSourcing) |
— |
||
nlapiSubmitFile(file) |
For a script sample, see N/file Module Script Samples. |
||
nlapiTransformRecord(type, id, transformType, transformValues) |
— |
||
nlapiTriggerWorkflow |
— |
||
nlapiValidateXML |
— |
||
nlapi |
Note that scripting subrecords in SuiteScript 2.x is fundamentally different from scripting subrecords in SuiteScript 1.0. For additional information, see the SuiteScript 2.x topics under SuiteScript 2.x Scripting Subrecords. |
||
nlapi |
Note that scripting subrecords in SuiteScript 2.x is fundamentally different from scripting subrecords in SuiteScript 1.0. For additional information, see the SuiteScript 2.x topics under SuiteScript 2.x Scripting Subrecords. SuiteScript 2.x begins sublist numbering with 0. SuiteScript 1.0 begins sublist numbering with 1. |
||
nlapiViewSubrecord |
Note that scripting subrecords in SuiteScript 2.x is fundamentally different from scripting subrecords in SuiteScript 1.0. For additional information, see the SuiteScript 2.x topics under SuiteScript 2.x Scripting Subrecords. |
||
nlapiVoidTransaction |
For a script sample, see N/transaction Module Script Samples |
||
nlapiXMLToPDF(xmlstring) |
Note that For a script sample, see N/render Module Script Sample. |
||
nlapiXMLToString(xml) |
— |
||
nlapiYieldScript() |
See Notes |
See Notes |
Note that the SuiteScript 2.x Map/Reduce Script Type automatically incorporates yielding. |