Record Types
This reference lists all record.Type enum values available in SuiteScript 2.x. Use these when loading, creating, or searching records.
Using Record Types
// Using the enum
var salesOrder = record.load({
type: record.Type.SALES_ORDER,
id: 123
});
// Using string value (equivalent)
var salesOrder = record.load({
type: 'salesorder',
id: 123
});
Entity Records
| Enum | String Value | Description |
|---|---|---|
CONTACT | contact | Contact record |
CUSTOMER | customer | Customer record |
EMPLOYEE | employee | Employee record |
LEAD | lead | Lead record |
OTHER_NAME | othername | Other name record |
PARTNER | partner | Partner record |
PROSPECT | prospect | Prospect record |
VENDOR | vendor | Vendor record |
Transaction Records
| Enum | String Value | Description |
|---|---|---|
ASSEMBLY_BUILD | assemblybuild | Assembly build |
ASSEMBLY_UNBUILD | assemblyunbuild | Assembly unbuild |
BLANKET_PURCHASE_ORDER | blanketpurchaseorder | Blanket PO |
CASH_REFUND | cashrefund | Cash refund |
CASH_SALE | cashsale | Cash sale |
CHECK | check | Check/Cheque |
CREDIT_CARD_CHARGE | creditcardcharge | Credit card charge |
CREDIT_CARD_REFUND | creditcardrefund | Credit card refund |
CREDIT_MEMO | creditmemo | Credit memo |
CUSTOMER_DEPOSIT | customerdeposit | Customer deposit |
CUSTOMER_PAYMENT | customerpayment | Customer payment |
CUSTOMER_REFUND | customerrefund | Customer refund |
DEPOSIT | deposit | Deposit |
DEPOSIT_APPLICATION | depositapplication | Deposit application |
ESTIMATE | estimate | Estimate/Quote |
EXPENSE_REPORT | expensereport | Expense report |
INTER_COMPANY_JOURNAL_ENTRY | intercompanyjournalentry | Intercompany journal |
INVENTORY_ADJUSTMENT | inventoryadjustment | Inventory adjustment |
INVENTORY_COUNT | inventorycount | Inventory count |
INVENTORY_TRANSFER | inventorytransfer | Inventory transfer |
INVOICE | invoice | Invoice |
ITEM_FULFILLMENT | itemfulfillment | Item fulfillment |
ITEM_RECEIPT | itemreceipt | Item receipt |
JOURNAL_ENTRY | journalentry | Journal entry |
OPPORTUNITY | opportunity | Opportunity |
PAYCHECK | paycheck | Paycheck |
PAYCHECK_JOURNAL | paycheckjournal | Paycheck journal |
PERIOD_END_JOURNAL | periodendjournal | Period end journal |
PURCHASE_CONTRACT | purchasecontract | Purchase contract |
PURCHASE_ORDER | purchaseorder | Purchase order |
PURCHASE_REQUISITION | purchaserequisition | Purchase requisition |
RETURN_AUTHORIZATION | returnauthorization | Return authorization |
SALES_ORDER | salesorder | Sales order |
TRANSFER_ORDER | transferorder | Transfer order |
VENDOR_BILL | vendorbill | Vendor bill |
VENDOR_CREDIT | vendorcredit | Vendor credit |
VENDOR_PAYMENT | vendorpayment | Vendor payment |
VENDOR_PREPAYMENT | vendorprepayment | Vendor prepayment |
VENDOR_PREPAYMENT_APPLICATION | vendorprepaymentapplication | Vendor prepayment application |
VENDOR_RETURN_AUTHORIZATION | vendorreturnauthorization | Vendor return auth |
WORK_ORDER | workorder | Work order |
WORK_ORDER_CLOSE | workorderclose | Work order close |
WORK_ORDER_COMPLETION | workordercompletion | Work order completion |
WORK_ORDER_ISSUE | workorderissue | Work order issue |
Item Records
| Enum | String Value | Description |
|---|---|---|
ASSEMBLY_ITEM | assemblyitem | Assembly item |
DESCRIPTION_ITEM | descriptionitem | Description item |
DISCOUNT_ITEM | discountitem | Discount item |
DOWNLOAD_ITEM | downloaditem | Download item |
GIFT_CERTIFICATE_ITEM | giftcertificateitem | Gift certificate item |
INVENTORY_ITEM | inventoryitem | Inventory item |
ITEM_GROUP | itemgroup | Item group |
KIT_ITEM | kititem | Kit item |
LOT_NUMBERED_ASSEMBLY_ITEM | lotnumberedassemblyitem | Lot numbered assembly |
LOT_NUMBERED_INVENTORY_ITEM | lotnumberedinventoryitem | Lot numbered inventory |
MARKUP_ITEM | markupitem | Markup item |
NON_INVENTORY_ITEM | noninventoryitem | Non-inventory item |
OTHER_CHARGE_ITEM | otherchargeitem | Other charge item |
PAYMENT_ITEM | paymentitem | Payment item |
SERIALIZED_ASSEMBLY_ITEM | serializedassemblyitem | Serialized assembly |
SERIALIZED_INVENTORY_ITEM | serializedinventoryitem | Serialized inventory |
SERVICE_ITEM | serviceitem | Service item |
SHIP_ITEM | shipitem | Ship item |
SUBTOTAL_ITEM | subtotalitem | Subtotal item |
Setup & Configuration Records
| Enum | String Value | Description |
|---|---|---|
ACCOUNT | account | Account |
ACCOUNTING_BOOK | accountingbook | Accounting book |
ACCOUNTING_PERIOD | accountingperiod | Accounting period |
BIN | bin | Bin |
BILLING_SCHEDULE | billingschedule | Billing schedule |
CLASSIFICATION | classification | Classification |
CURRENCY | currency | Currency |
DEPARTMENT | department | Department |
LOCATION | location | Location |
NEXUS | nexus | Nexus |
PRICE_LEVEL | pricelevel | Price level |
SUBSIDIARY | subsidiary | Subsidiary |
TAX_GROUP | taxgroup | Tax group |
TAX_PERIOD | taxperiod | Tax period |
TERM | term | Term |
UNITS_TYPE | unitstype | Units type |
CRM Records
| Enum | String Value | Description |
|---|---|---|
CALENDAR_EVENT | calendarevent | Calendar event |
CAMPAIGN | campaign | Campaign |
CAMPAIGN_RESPONSE | campaignresponse | Campaign response |
CAMPAIGN_TEMPLATE | campaigntemplate | Campaign template |
COMPETITOR | competitor | Competitor |
ISSUE | issue | Issue/Case |
MESSAGE | message | Message |
NOTE | note | Note |
PHONE_CALL | phonecall | Phone call |
PROMOTION_CODE | promotioncode | Promotion code |
SUPPORT_CASE | supportcase | Support case |
TASK | task | Task |
TOPIC | topic | Topic |
Project & Resource Records
| Enum | String Value | Description |
|---|---|---|
JOB | job | Job/Project |
JOB_STATUS | jobstatus | Job status |
JOB_TYPE | jobtype | Job type |
PROJECT_EXPENSE_TYPE | projectexpensetype | Project expense type |
PROJECT_TASK | projecttask | Project task |
PROJECT_TEMPLATE | projecttemplate | Project template |
RESOURCE_ALLOCATION | resourceallocation | Resource allocation |
TIME_BILL | timebill | Time bill |
TIME_ENTRY | timeentry | Time entry |
TIME_SHEET | timesheet | Time sheet |
Scripting Records
| Enum | String Value | Description |
|---|---|---|
BUNDLE_INSTALLATION_SCRIPT | bundleinstallationscript | Bundle installation script |
CLIENT_SCRIPT | clientscript | Client script |
MAP_REDUCE_SCRIPT | mapreducescript | Map/Reduce script |
MASSUPDATE_SCRIPT | massupdatescript | Mass update script |
RESTLET | restlet | RESTlet |
SCHEDULED_SCRIPT | scheduledscript | Scheduled script |
SCHEDULED_SCRIPT_INSTANCE | scheduledscriptinstance | Scheduled script instance |
SCRIPT_DEPLOYMENT | scriptdeployment | Script deployment |
SUITELET | suitelet | Suitelet |
USEREVENT_SCRIPT | usereventscript | User event script |
WORKFLOW_ACTION_SCRIPT | workflowactionscript | Workflow action script |
Custom Records
For custom record types, use the string ID:
var customRecord = record.load({
type: 'customrecord_myrecord',
id: 123
});
Usage Examples
Loading Records
// Load a customer
var customer = record.load({
type: record.Type.CUSTOMER,
id: 123,
isDynamic: true
});
// Load an invoice
var invoice = record.load({
type: record.Type.INVOICE,
id: 456
});
Creating Records
// Create a new sales order
var salesOrder = record.create({
type: record.Type.SALES_ORDER,
isDynamic: true
});
salesOrder.setValue({
fieldId: 'entity',
value: customerId
});
Searching Records
// Search for customers
var customerSearch = search.create({
type: search.Type.CUSTOMER,
filters: [
['isinactive', 'is', 'F']
],
columns: ['entityid', 'email', 'phone']
});
Deleting Records
// Delete a record
record.delete({
type: record.Type.SALES_ORDER,
id: 128
});