/* from: http://blog.csdn.net/levin_rain/article/details/8571444 */
' 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. '