Skip to main content

Custom Fields

Add custom data fields to any NetSuite record type.


Field Categories

CUSTOM FIELD CATEGORIES
═══════════════════════════════════════════════════════════════════════════════

NAVIGATION: Customization → Lists, Records, & Fields

┌─────────────────────────────────────────────────────────────────────────────┐
│ Entity Fields │ Fields on Customer, Vendor, Employee, etc. │
│ Item Fields │ Fields on all item types │
│ CRM Fields │ Fields on Cases, Tasks, Events, Campaigns │
│ Transaction Body │ Header fields on transactions │
│ Transaction Line │ Line-level fields on transactions │
│ Transaction Column │ Sublist columns on transactions │
│ Other Record Fields │ Fields on other standard records │
└─────────────────────────────────────────────────────────────────────────────┘

Field Area Deep Dives


Creating a Custom Field

Step-by-Step Process

CUSTOM FIELD CREATION
═══════════════════════════════════════════════════════════════════════════════

Step 1: Navigate to field type
Customization → Lists, Records, & Fields → [Field Type] → New

Step 2: Configure Basic Information
┌─────────────────────────────────────────────────────────────────────────────┐
│ Label: Project Code │
│ ID: custbody_project_code (auto-prefixed) │
│ Type: Free-Form Text │
│ Description: Reference code for project tracking │
│ │
│ Store Value: ☑ (saves to database) │
│ Show in List: ☐ (appears in list views) │
└─────────────────────────────────────────────────────────────────────────────┘

Step 3: Set Applies To (Transaction Body example)
┌─────────────────────────────────────────────────────────────────────────────┐
│ Transaction Types: │
│ ☑ Sales Order │
│ ☑ Invoice │
│ ☐ Purchase Order │
│ ☐ Bill │
│ ☐ Journal Entry │
│ ☐ All transaction types │
└─────────────────────────────────────────────────────────────────────────────┘

Step 4: Configure Display
┌─────────────────────────────────────────────────────────────────────────────┐
│ Subtab: Custom │
│ Display Type: Normal │
│ Display Width: 30 │
│ Display Height: 1 │
│ Help Text: Enter the project code for this transaction │
└─────────────────────────────────────────────────────────────────────────────┘

Step 5: Set Validation
┌─────────────────────────────────────────────────────────────────────────────┐
│ ☐ Mandatory │
│ ☐ Check Spelling │
│ ☐ Unique │
│ Max Length: 50 │
└─────────────────────────────────────────────────────────────────────────────┘

Field Display Types

DISPLAY TYPE OPTIONS
═══════════════════════════════════════════════════════════════════════════════

┌────────────────────┬────────────────────────────────────────────────────────┐
│ Normal │ Editable field, standard display │
├────────────────────┼────────────────────────────────────────────────────────┤
│ Hidden │ Not visible on form (scripting use only) │
├────────────────────┼────────────────────────────────────────────────────────┤
│ Inline Text │ Display-only, no edit capability │
├────────────────────┼────────────────────────────────────────────────────────┤
│ Disabled │ Visible but grayed out (cannot edit) │
├────────────────────┼────────────────────────────────────────────────────────┤
│ Locked │ Visible, editable only via script │
└────────────────────┴────────────────────────────────────────────────────────┘

Role-Based Display:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Different display type per role: │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Role │ Display Type │ │
│ ├───────────────────┼───────────────────────────────────────────────────┤ │
│ │ Administrator │ Normal │ │
│ │ Sales Rep │ Inline Text │ │
│ │ A/R Clerk │ Hidden │ │
│ └───────────────────┴───────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

Sourcing and Filtering

Sourcing Field Values

Automatically populate field based on related record.

SOURCING CONFIGURATION
═══════════════════════════════════════════════════════════════════════════════

Example: Source customer's email to Sales Order

Field Setup:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Field Label: Customer Email │
│ Type: Email Address │
│ Applies To: Sales Order (Body Field) │
│ │
│ Sourcing Tab: │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Source List: Customer │ │
│ │ Source From: Customer (entity field on SO) │ │
│ │ Source Field: Email │ │
│ │ │ │
│ │ When customer is selected, email auto-populates │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

How it works:
1. User selects customer on Sales Order
2. System looks up customer's email
3. Field auto-populates with email value

Filtering Field Options

Limit dropdown selections based on context.

FILTERING CONFIGURATION
═══════════════════════════════════════════════════════════════════════════════

Example: Filter contacts by selected customer

Field Setup:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Field Label: Primary Contact │
│ Type: List/Record (Contact) │
│ Applies To: Sales Order (Body Field) │
│ │
│ Sourcing Tab - Filter By: │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Filter Using: Customer │ │
│ │ Compare Field: Company (on Contact record) │ │
│ │ Compare To: Customer (entity on Sales Order) │ │
│ │ │ │
│ │ Only contacts linked to selected customer appear in dropdown │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

Default Values

DEFAULT VALUE OPTIONS
═══════════════════════════════════════════════════════════════════════════════

Static Default:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Default Value: "Pending Review" │
│ Always starts with this value │
└─────────────────────────────────────────────────────────────────────────────┘

Formula Default:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Default: {today} │
│ Current date when record created │
│ │
│ Available formulas: │
│ • {today} │
│ • {now} │
│ • {user} │
│ • {subsidiary} │
│ • {role} │
└─────────────────────────────────────────────────────────────────────────────┘

Checkbox Default:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Default Checked: ☑ │
│ Checkbox starts as checked │
└─────────────────────────────────────────────────────────────────────────────┘

Accessing Custom Fields

In Scripts

// Read custom field
const projectCode = record.getValue({
fieldId: 'custbody_project_code'
});

// Set custom field
record.setValue({
fieldId: 'custbody_project_code',
value: 'PROJ-001'
});

// Line-level custom field
const lineValue = record.getSublistValue({
sublistId: 'item',
fieldId: 'custcol_delivery_date',
line: 0
});

In SuiteQL

-- Transaction body field
SELECT
t.tranid,
t.custbody_project_code AS project_code
FROM
transaction t
WHERE
t.custbody_project_code IS NOT NULL

-- Entity field
SELECT
c.companyname,
c.custentity_industry AS industry
FROM
customer c
WHERE
c.custentity_industry = 1

-- Transaction line field
SELECT
t.tranid,
tl.item,
tl.custcol_delivery_date AS delivery_date
FROM
transactionline tl
JOIN
transaction t ON tl.transaction = t.id

Field ID Prefixes

FIELD ID NAMING
═══════════════════════════════════════════════════════════════════════════════

System-assigned prefixes:
┌─────────────────────────────────────────────────────────────────────────────┐
│ custbody_ │ Transaction body (header) fields │
│ custcol_ │ Transaction column (line) fields │
│ custentity_ │ Entity fields (customer, vendor, employee) │
│ custitem_ │ Item fields │
│ custevent_ │ CRM event fields │
│ custrecord_ │ Custom record fields │
│ custpage_ │ Suitelet page elements │
└─────────────────────────────────────────────────────────────────────────────┘

Example IDs:
custbody_project_code → SO header field
custcol_delivery_instructions → SO line field
custentity_vip_customer → Customer field
custitem_country_origin → Item field

Conditional Mandatory Fields (Required When...)

Make a field required based on another field's value.

Use Case Examples

ScenarioConditionRequired Field
Expected Ship Date required when Shipping Method selectedShipping Method ≠ blankExpected Ship Date
Tax Exempt Reason required when Tax Exempt = YesTax Exempt = checkedExemption Certificate
Rejection Notes required when status = RejectedApproval Status = "Rejected"Rejection Notes
WORKFLOW - SET FIELD MANDATORY
═══════════════════════════════════════════════════════════════════════════════

Record Type: Sales Order
Trigger: On Before Record Submit

State: Check Conditional Requirements
┌─────────────────────────────────────────────────────────────────────────────┐
│ Entry Actions: │
│ │
│ 1. Set Field Mandatory Action: │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ Field: Expected Ship Date │ │
│ │ Mandatory: ☑ Yes │ │
│ │ │ │
│ │ Condition: │ │
│ │ {custbody_shipping_method} is not empty │ │
│ │ │ │
│ │ (Only execute when shipping method is selected) │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │
│ Result: If user selects a shipping method but leaves Expected Ship Date │
│ blank, the save will fail with validation error │
└─────────────────────────────────────────────────────────────────────────────┘

Approach 2: Using Client Script (More Flexible)

/**
* Client Script - Conditional Mandatory Field
* Makes Expected Ship Date required when Shipping Method is selected
*
* @NApiVersion 2.1
* @NScriptType ClientScript
*/
define(['N/currentRecord'], function(currentRecord) {

function pageInit(context) {
checkShippingMethodMandatory(context.currentRecord);
}

function fieldChanged(context) {
if (context.fieldId === 'custbody_shipping_method') {
checkShippingMethodMandatory(context.currentRecord);
}
}

function checkShippingMethodMandatory(record) {
var shippingMethod = record.getValue('custbody_shipping_method');
var shipDateField = record.getField('custbody_expected_ship_date');

if (shippingMethod) {
// Shipping method selected - make date required
shipDateField.isMandatory = true;
} else {
// No shipping method - date is optional
shipDateField.isMandatory = false;
}
}

function saveRecord(context) {
var record = context.currentRecord;
var shippingMethod = record.getValue('custbody_shipping_method');
var expectedDate = record.getValue('custbody_expected_ship_date');

if (shippingMethod && !expectedDate) {
alert('Expected Ship Date is required when a Shipping Method is selected.');
return false; // Prevent save
}
return true;
}

return {
pageInit: pageInit,
fieldChanged: fieldChanged,
saveRecord: saveRecord
};
});

Approach 3: Using User Event (Server-Side Validation)

/**
* User Event Script - Server-side conditional mandatory
*
* @NApiVersion 2.1
* @NScriptType UserEventScript
*/
define(['N/error'], function(error) {

function beforeSubmit(context) {
var record = context.newRecord;

var shippingMethod = record.getValue('custbody_shipping_method');
var expectedDate = record.getValue('custbody_expected_ship_date');

if (shippingMethod && !expectedDate) {
throw error.create({
name: 'MISSING_REQUIRED_FIELD',
message: 'Expected Ship Date is required when a Shipping Method is selected.',
notifyOff: false
});
}
}

return {
beforeSubmit: beforeSubmit
};
});

Comparison: Which Approach to Use?

ApproachBest ForProsCons
WorkflowSimple conditions, non-developersNo code, UI-based, easy to modifyLimited to workflow-supported conditions
Client ScriptReal-time UI feedbackImmediate visual feedback, field stylingOnly runs in UI (bypassed by API)
User EventGuaranteed validationCatches all saves (UI, API, import)No real-time UI feedback
CombinedProduction systemsBest of both worldsMore code to maintain

[!TIP] For critical business rules, use both Client Script (for user experience) AND User Event (for data integrity).


Next Steps

GoalGo To
Form customizationCustom Forms →
Return to Suite BuilderSuite Builder →
Build workflowsWorkflows →