DSI NetSuite Interface RESTlet Guide
About this guide
This guide contains detailed information about the RESTlets that Mobile Enterprise Platform uses as the communication interface with a NetSuite ERP system.
The guide is subject to change as the interface continues to be developed. If you have downloaded this guide in the past, please ensure you are viewing the most recently posted version.
About DSI NetSuite interface RESTlets
Mobile Enterprise Platform communicates with a NetSuite ERP system via RESTlets.
About RESTlets
RESTlet is a REST framework for Java. REST, or Representational State Transfer, is a method of utilizing HTTP protocols to transfer data in a compact, resource oriented, package. A RESTful communication is an HTTP request/response containing the HTTP method, header, URL (with possible GET parameters), and body. The body of a RESTlet request/response consists of either plain text or a JSON string containing the data.
NetSuite utilizes RESTlet for its server-side RESTful web service. RESTlet scripts, referred to as RESTlets in this guide, offer ease of adoption for developers familiar with SuiteScript (which is similar to JavaScript), and they support more behaviors than NetSuite's SOAP-based SuiteTalk web services. Compared with SOAP/SuiteTalk, RESTlets are lighter weight, more suitable for mobile devices, and can be distributed as a NetSuite bundle. For bundle installation and custom bundle field information, refer to
RESTlets in the Advanced Inventory NetSuite Connector Bundle contain two roles. DSI_MobileClient_User is designed for the type of user who might work on the warehouse floor or at a manufacturing bench. DSI_MobileClient_User_Enhanced_Permission is designed for back-office and accounting users.
The RESTlets in this guide are used to create service definitions in Mobile Enterprise Platform's Application Studio.
About NetSuite
NetSuite is a cloud-based ERP system that, compared to other ERPs, has different ways of organizing data and unique challenges in its multi-client multi-server environment. The following topics address the common requirements and best-practices that Advanced Inventory RESTlets must conform to.
About record types
NetSuite exposes data to its users in the form of records.
Instead of SQL tables, NetSuite uses record types, sub-list types, and sub-record types. A NetSuite record type is required for every RESTlet that interacts with a record. Sub-list or sub-record types are required for every RESTlet that interacts with appendant data “joined” to the parent record.
For a full list of record types, refer to Record types.
About record search criteria
Most of the Advanced Inventory RESTlets contain a searching selection to indicate the NetSuite record or records upon which the requested operation will be taken.
When either the body fields or sub-list fields have values specified, the RESTlet operates on an array of one or more records that match the criteria. When an internalid or name field (tranid, entityid, itemid) is specified, the RESTlet operates on only that specific record.
About date criteria
Large numbers of matching records can impact performance or cause a NetSuite time-out or script execution limit error.
Consider adding a date range criteria to transaction RESTlets to narrow the results to a manageable size.
For a list of supported date criteria, refer to Data filter operators.
About error objects
Each RESTlet can return a NetSuite error object.
The object name is error, and it contains the fields code and message. Each Advanced Inventory service definition that calls a RESTlet should include an output structure to catch and display possible errors.
NetSuite Governance
Because of the shared nature of NetSuite's servers, NetSuite has imposed a governance system on SuiteScripts, including RESTlets.
When a script makes too many API calls, invokes a very slow search, or simply takes too long to run, NetSuite terminates the script and returns an error.
Common governance errors
Error code | Message |
---|---|
SSS_INSTRUCTION_COUNT_EXCEEDED | The script has executed too many lines of code; probably due to a loop iterating over too much data. |
SSS_SEARCH_TIMEOUT | You may need to refine your search to reduce the number of records being searched. |
SSS_TIME_LIMIT_EXCEEDED | Although one of the other errors has not happened, the whole script took too long to execute. |
SSS_USAGE_LIMIT_EXCEEDED | The script has executed too many NetSuite API calls. See NetSuite's documentation for per-call governance costs. |
EXCEEDED_MAX_CONCUR_RQST | Too many RESTlets tried to access NetSuite simultaneously. Resend the request in a moment. |
Bundle information
Bundle information for NetSuite RESTlets.
Bundle installation steps
-
Provide Advanced Inventory team with the client's NetSuite Company ID.
-
Install the core bundle.
-
Install any optional custom bundle, if applicable.
-
Enable Token Based Authentication (TBA).
-
Create a generic rest user/employee. The recommended format is: companyname_rest@yourdomain.com.
-
Assign custom roles to the generic rest user, and any other employees desired.
-
If this is a NetSuite OneWorld account, assign a subsidiary to the generic user.
-
Check Give Access.
-
Create Password.
-
-
Edit custom role.
-
Add permissions for any custom records unique to this client .
-
If this is a NetSuite OneWorld account, add lists -> subsidiaries permission.
-
-
Provide the Advanced Inventory team with generic user's password and the role internal id(s).
-
Finally, the Advanced Inventory Team runs the Token Endpoint, one time, to acquire OAuth 1.0 tokens.
Bundle custom fields
Label | Internal ID | Type of field |
---|---|---|
DSI_DateLastReplicated | custevent_dsi_datelastreplicated | CRM |
DSI_DateLastReplicated | custentity_dsi_datelastreplicated | Entity |
DSI_DateLastReplicated | custitem_dsi_datelastreplicated | Item |
DSI_DateLastReplicated | custbody_dsi_datelastreplicated | Transaction Body |
Advanced Inventory Transaction Number | custbody_dsi_transaction_number | Transaction Body |
Last Advanced Inventory User | custrecord_dsi_mc_username | Bin |
Last Advanced Inventory User | custevent_dsi_mc_username | CRM |
Last Advanced Inventory User | custentity_dsi_mc_username | Entity |
Last Advanced Inventory User | custitem_dsi_mc_username | Item |
Last Advanced Inventory User | custbody_dsi_mc_username | Transaction Body |
Last Advanced Inventory User | custcol_dsi_mc_username | Transaction Column |
UPC | custcol_dsi_upccode | Transaction Column |
Data filter operators
Search values for date fields must be either a date or a relative parameter.
Date must be in the format, mm/dd/yyyy with no leading zeros in month or day. The relative parameter daysagoX allows specifying a date relative to the current date; where the X is a number representing the number of days e.g. daysago90, daysago3.
Date filter | Search value |
---|---|
after |
Date (mm/dd/yyyy), daysagoX |
notafter |
Date (mm/dd/yyyy), daysagoX |
before |
Date (mm/dd/yyyy), daysagoX |
notbefore |
Date (mm/dd/yyyy), daysagoX |
on |
Date (mm/dd/yyyy), daysagoX |
noton |
Date (mm/dd/yyyy), daysagoX |
onorafter |
Date (mm/dd/yyyy), daysagoX |
notonorafter |
Date (mm/dd/yyyy), daysagoX |
onorbefore |
Date (mm/dd/yyyy), daysagoX |
notonorbefore |
Date (mm/dd/yyyy), daysagoX |
isempty |
‘null' |
Isnotempty |
‘null' |
within |
daysagoX |
notwithin |
daysagoX |
Record types
Record types
Record | Record type ID | Filter | Category |
---|---|---|---|
Account |
account |
|
List |
Accounting Book |
accountingbook |
List |
|
Multi-Book Accounting Transaction |
accountingtransaction |
Transaction |
|
Activity |
activity |
Activity |
|
Address |
addressbookaddress |
Subrecord |
|
Amortization Schedule |
amortizationschedule |
List |
|
Amortization Template |
amortizationtemplate |
List |
|
Assembly Build |
assemblybuild |
Transaction |
|
Assembly Item |
assemblyitem |
Assembly |
Item |
Assembly Unbuild |
assemblyunbuild |
Transaction |
|
Billing Class |
billingclass |
List |
|
Billing Schedule |
billingschedule |
List |
|
Bin |
bin |
List |
|
Bin Transfer |
bintransfer |
Transaction |
|
Bin Putaway Worksheet |
binworksheet |
BinWksht |
Transaction |
Blanket Purchase Order |
blanketpurchaseorder |
Transaction |
|
Event |
calendarevent |
Activity |
|
Campaign |
campaign |
Marketing |
|
Campaign Template |
campaigntemplate |
Marketing |
|
Cash Refund |
cashrefund |
CashRfnd |
Transaction |
Cash Sale |
cashsale |
CashSale |
Transaction |
Charge |
charge |
CardChrg |
Transaction |
Check |
check |
Check |
Transaction |
Class |
classification |
List |
|
Commission |
commission |
Commissn |
Transaction |
Competitor |
competitor |
Entity |
|
Contact |
contact |
Contact |
Entity |
Coupon Code |
couponcode |
Marketing |
|
Credit Memo |
creditmemo |
CustCred |
Transaction |
Currency |
currency |
List |
|
Currency Revaluation |
currencyrevaluation |
FxReval |
Transaction |
Customer |
customer |
Entity |
|
Customer Category |
customercategory |
List |
|
Customer Deposit |
customerdeposit |
CustDep |
Transaction |
Customer Payment |
customerpayment |
CustPymt |
Transaction |
Customer Refund |
customerrefund |
Transaction |
|
Department |
department |
List |
|
Deposit |
deposit |
Deposit |
Transaction |
Deposit Application |
depositapplication |
DepAppl |
Transaction |
Description |
descriptionitem |
Description |
Item |
Discount |
discountitem |
Item |
|
Download Item |
downloaditem |
DwnLdItem |
Item |
Email Template |
emailtemplate |
Marketing |
|
Employee |
employee |
Entity |
|
Entity |
entity |
Entity |
|
Group |
entitygroup |
List |
|
Estimate / Quote |
estimate |
Estimate |
Transaction |
Expense Category |
expensecategory |
List |
|
Expense Report |
expensereport |
ExpRept |
Transaction |
Folder |
folder |
File Cabinet |
|
Generic Resource |
genericresource |
Entity |
|
Gift Certificate |
giftcertificate |
List |
|
Gift Certificate Item |
giftcertificateitem |
GiftCert |
Item |
Global Account Mapping |
globalaccountmapping |
List |
|
Intercompany Journal Entry |
intercompanyjournalentry |
Transaction |
|
Intercompany Transfer Order |
intercompanytransferorder |
Transaction |
|
Inventory Adjustment |
inventoryadjustment |
InvAdjst |
Transaction |
Inventory Cost Revaluation |
inventorycostrevaluation |
InvReval |
Transaction |
Inventory Count |
inventorycount |
InvCount |
Transaction |
Inventory Detail |
inventorydetail |
Subrecord |
|
Inventory Distribution |
inventorydistribution |
InvDistr |
Transaction |
Inventory Item |
inventoryitem |
InvtPart |
Item |
Inventory Number |
inventorynumber |
List |
|
Inventory Transfer |
inventorytransfer |
InvTrnfr |
Transaction |
Physical Inventory Worksheet |
inventoryworksheet |
InvWksht |
Transaction |
Invoice |
invoice |
CustInvc |
Transaction |
Issue |
issue |
Support |
|
Item Search |
item |
Item |
|
Item Account Mapping |
itemaccountmapping |
List |
|
Item Demand Plan |
itemdemandplan |
Transaction |
|
Item Fulfillment |
itemfulfillment |
ItemShip |
Transaction |
Item Group |
itemgroup |
Item |
|
Item Receipt |
itemreceipt |
ItemRcpt |
Transaction |
Item Revision |
itemrevision |
List |
|
Item Supply Plan |
itemsupplyplan |
Transaction |
|
Project (Job) |
job |
CustJob |
Entity |
Journal Entry |
journalentry |
Journal |
Transaction |
Kit |
kititem |
Kit |
Item |
Landed Cost |
landedcost |
Subrecord |
|
Lead |
lead |
Entity |
|
Location |
location |
List |
|
Lot Numbered Assembly Item |
lotnumberedassemblyitem |
Item |
|
Lot Numbered Inventory Item |
lotnumberedinventoryitem |
Item |
|
Manufacturing Cost Template |
manufacturingcosttemplate |
List |
|
Manufacturing Operation Task |
manufacturingoperationtask |
Transaction |
|
Manufacturing Routing |
manufacturingrouting |
List |
|
Markup |
markupitem |
Markup |
Item |
Message |
message |
Communication |
|
Manufacturing Planned Time |
mfgplannedtime |
Transaction |
|
Nexus |
nexus |
List |
|
Non-Inventory Part |
noninventoryitem |
NonInvtPar |
Item |
Note |
note |
Communication |
|
Opportunity |
opportunity |
Opprtnty |
Transaction |
Other Charge Item |
otherchargeitem |
OthCharge |
Item |
Other Name |
othername |
Entity |
|
Partner |
partner |
Entity |
|
Paycheck Journal |
paycheckjournal |
Paycheck |
Transaction |
Payment |
paymentitem |
Payment |
Item |
Payroll Item |
payrollitem |
List |
|
Phone Call |
phonecall |
Activity |
|
Price Level |
pricelevel |
Lists |
|
Project Expense Type |
projectexpensetype |
List |
|
Project Task |
projecttask |
Event |
|
Project Template |
projecttemplate |
Entity |
|
Promotion |
promotioncode |
Marketing |
|
Prospect |
prospect |
Entity |
|
Purchase Contract |
purchasecontract |
PurchCon |
Transaction |
Purchase Order |
purchaseorder |
PurchOrd |
Transaction |
Requisition |
purchaserequisition |
Transaction |
|
Reallocate Items |
reallocateItem |
Item |
|
Resource Allocation |
resourceallocation |
Activities |
|
Return Authorization |
returnauthorization |
RtnAuth |
Transaction |
Revenue Commitment Reversal |
revenuecommitmentreversal |
Transaction |
|
Revenue Commitment |
revenuecommitment |
Transaction |
|
Revenue Recognition Schedule |
revrecschedule |
List |
|
Revenue Recognition Template |
revrectemplate |
List |
|
Role |
role |
List |
|
Sales Order |
salesorder |
SalesOrd |
Transaction |
Sales Tax Item |
salestaxitem |
TaxItem |
List |
Serialized Assembly Item |
serializedassemblyitem |
Item |
|
Serialized Inventory Item |
serializedinventoryitem |
Item |
|
Service |
serviceitem |
Service |
Item |
Shipping Item |
shipitem |
ShipItem |
Item |
Solution |
solution |
Support |
|
Statistical Journal Entry |
statisticaljournalentry |
Transaction |
|
Subsidiary |
subsidiary |
List |
|
Subtotal |
subtotalitem |
Subtotal |
Item |
Case |
supportcase |
Support |
|
Task |
task |
Activity |
|
Tax Control Account |
taxacct |
List |
|
Tax Group |
taxgroup |
TaxGroup |
List |
Tax Payment |
taxpayment |
TaxPymt |
Transaction |
Tax Period |
taxperiod |
List |
|
Tax Type |
taxtype |
List |
|
Term |
term |
List |
|
Time |
timebill |
Transaction |
|
Time Entry |
timeentry |
Subrecord |
|
Timesheet |
timesheet |
Transaction |
|
Topic |
topic |
Support |
|
Transfer Order |
transferorder |
TrnfrOrd |
Transaction |
Unit of Measure |
unitstype |
List |
|
Vendor |
vendor |
Entity |
|
Vendor Bill |
vendorbill |
VendBill |
Transaction |
Vendor Category |
vendorcategory |
List |
|
Vendor Credit |
vendorcredit |
VendCred |
Transaction |
Vendor Payment |
vendorpayment |
VendPymt |
Transaction |
Vendor Return Authorization |
vendorreturnauthorization |
VendAuth |
Transaction |
Web Site Setup |
website |
Website |
|
Work Order |
workorder |
WorkOrd |
Transaction |
Word Order Build Worksheet |
workorderbuild |
Build |
Transaction |
Work Order Close |
workorderclose |
WOClose |
Transaction |
Work Order Completion |
workordercompletion |
WOCompl |
Transaction |
Work Order Issue |
workorderissue |
WOIssue |
Transaction |
Search filter expression
A search filter expression is a JavaScript string array of zero or more elements.
Each element is one of the following.
-
Operator
-
Filter term
-
Nested search filter expression
Operator
An operator (string) can be one of the following.
-
"AND"
-
"OR"
-
"NOT"
The following are the usage guidelines for operators.
-
Operators are case insensitive. “and”, “or”, and “not” work the same as “AND”, “OR”, and “NOT”.
-
"NOT" must be followed by a filter term or a search filter expression.
-
"AND" or “OR” must be preceded and followed by a filter term or search filter expression.
Filter term
A filter term is a JavaScript array that is composed of three or more elements, as follows.
-
Filter identifier: a JavaScript string of the form:
-
filter_name: (such as amount) This is equivalent to new nlobjSearchFilter( “amount”, null, ...) where “amount” is the internal ID of the search field.
-
join_id.filter_name: (such as customer.salesrep) This is equivalent to new nlobjSearchFilter( “salesrep”, “customer”, ...) where “customer” is the search join id used for the search field specified as filter name “salesrep”. The filter name in this case may not be a formula filter like “formulatext: ...”.
-
For a list of search join ids and filter names associated to a record, see the SuiteScript Records Browser.
-
-
formula_type: Such as “formulatext: SUBSTR({custentity_myfield}, 3))” or "formulanumeric: CASE WHEN {quantityonhand} > {quantitycommitted} THEN 1 ELSE 0 END".
-
aggregate_function(filter_identifier): (such as max(amount)): The filter_identifier itself can contain a joined record, or can be a formula filter. However, it cannot be both a joined record and a formula filter.
-
-
Operator: a JavaScript string.
-
Operator: a JavaScript string or integer.
-
Optional: Additional operands
For an example, refer to Run search with filter expression.
Search operators
The following table lists each field type and its supported search operator.
Search Operator | List/Record | Number, Time of Day | Date | Document, Image | Text | Multi Select |
---|---|---|---|---|---|---|
after | ● | |||||
allof | ● | |||||
any | ● | ● | ||||
anyof | ● | ● | ● | |||
before | ● | |||||
between | ● | |||||
contains | ● | |||||
doesnotcontain | ● | |||||
doesnotstartwith | ● | |||||
equalto | ● | |||||
greaterthan | ● | |||||
greaterthanorequalto | ● | |||||
haskeywords | ● | |||||
is | ● | |||||
isempty | ● | ● | ● | |||
isnot | ● | |||||
isnotempty | ● | ● | ● | |||
lessthan | ● | |||||
lessthanorequalto | ● | |||||
noneof | ● | ● | ● | |||
notafter | ● | |||||
notallof | ● | |||||
notbefore | ● | |||||
notbetween | ● | |||||
notequalto | ● | |||||
notgreaterthan | ● | |||||
notgreaterthanorequalto | ● | |||||
notlessthan | ● | |||||
notlessthanorequalto | ● | |||||
noton | ● | |||||
notonorafter | ● | |||||
notonorbefore | ● | |||||
notwithin | ● | |||||
on | ● | |||||
onorafter | ● | |||||
onorbefore | ● | |||||
startswith | ● | |||||
within | ● |
Supported file types
The following table provides a list of all file types than can be uploaded or downloaded in the following RESTlets.
File type ID | Name | Extension | Content type |
---|---|---|---|
AUTOCAD |
AutoCad |
.dwg |
application/x-autocad |
BMPIMAGE |
BMP Image |
.bmp |
image/x-xbitmap |
CSV |
CSV File |
.csv |
text/csv |
EXCEL |
Excel File |
.xls |
application/vnd.ms-excel |
FLASH |
Flash Animation |
.swf |
application/x-shockwave-flash |
GIFIMAGE |
GIF Image |
.gif |
image/gif |
GZIP |
GNU Zip File |
.gz |
application/x-gzip-compressed |
HTMLDOC |
HTML File |
.htm |
text/html |
ICON |
Icon Image |
.ico |
image/ico |
JAVASCRIPT |
JavaScript File |
.js |
text/javascript |
JPGIMAGE |
JPEG Image |
.jpg |
image/jpeg |
JSON |
JSON File |
.json |
application/json |
MESSAGERFC |
Message RFC |
.eml |
message/rfc822 |
MP3 |
MP3 Audio |
.mp3 |
audio/mpeg |
MPEGMOVIE |
MPEG Video |
.mpg |
video/mpeg |
MSPROJECT |
Project File |
.mpp |
application/vnd.ms-project |
PDF |
PDF File |
.pdf |
application/pdf |
PJPGIMAGE |
PJPEG Image |
.pjpeg |
image/pjpeg |
PLAINTEXT |
Plain Text File |
.txt |
text/plain |
PNGIMAGE |
PNG Image |
.png |
image/x-png |
POSTSCRIPT |
PostScript File |
.ps |
application/postscript |
POWERPOINT |
PowerPoint File |
.ppt |
application/vnd.ms-powerpoint |
QUICKTIME |
QuickTime Video |
.mov |
video/quicktime |
RTF |
RTF File |
.rtf |
application/rtf |
SMS |
SMS File |
.sms |
application/sms |
STYLESHEET |
CSS File |
.css |
text/css |
TIFFIMAGE |
TIFF Image |
.tiff |
image/tiff |
VISIO |
Visio File |
.vsd |
application/vnd.visio |
WORD |
Word File |
.doc |
application/msword |
XMLDOC |
XML File |
.xml |
text/xml |
ZIP |
Zip File |
.zip |
application/zip |
Loading...
There was a problem loading this topic