How to Create a Custom Field to a NetSuite Customer or Transaction
Table of Contents
NetSuite custom fields are incredibly powerful and flexible, but they are not easy to work with! Below is a quick guide that walks through how to create customer and transaction custom fields and some tips and tricks for working with custom fields.
How to create a custom customer (i.e. entity) field in NetSuite:
- Navigate to: Customization > Lists, Records & Fields > Entity Fields > New
- Label: use a name you’d like to see displayed on your customer.
- Type: “Free-form Text”. There are cases where you won’t want to use free-form text, but in most cases this is the best option.
- ID: “_a_internal_identifier”. Note that you should start your identifier with a
_
sincecustentity
will be prepended to whatever you provide here. You’ll want to change “_a_internal_identifier” to an ID that is descriptive of this field in your setup. - Store value: checked
- Applies to: Customer
- Save
How to create a transaction (invoice, cash sale, order, payment, etc) field in NetSuite:
- Navigate to: Customization > Transaction Body Fields > New
- Label: use a name you’d like to see displayed on your transaction.
- ID:
_a_internal_identifier
. Note that you should start your identifier with a_
sincecustbody
will be prepended to whatever you provide here. - Type: free form text
- Store Value: checked
- Applies to: Sale, Payment, etc. Where you want this field displayed is up to your use-case.
- Global Search: checked. This enables you to search for the value in the NetSuite global search
- Save
Other Tips & Tricks for Working With NetSuite Custom Fields
- Customer (entity) custom fields will always start with
custentity
. Transaction (invoice, sales order, payment, etc) custom fields will always start withcustbody
. - You can create custom fields on most, but not all records. For instance, you can’t create a custom field on the currency record in NetSuite but you can create one on a subsidiary.
- It’s possible to access “hidden” fields that are not available through SuiteTalk or SuiteScript using field defaults or formula field defaults on custom fields.
- You can source values from a related record. For instance, if you want to source a value from a CashSale connected to a CashRefund you could use a formula like
{createdfrom.externalid}
as the default value for a field that doesn’t store a value. - A field which does not store value (i.e. a field that just contains a default value) is not available via a formula on another field. A field not found error will be reported. In other words, you can’t nest formulas. This is a huge bummer.
- If “formula” is not checked when creating the custom field you can still substitute field values using the
{field}
syntax - You’ll get
ERROR: Invalid Expression
for lots of different types of errors. For instance, if your formula doesn’t output the correct field type you’ll get this error. This makes it very challenging to debug why a formula isn’t working. - Join fields (i.e.
{entity.datecreated}
) strips the value of its type. Everything comes over as a string. - You can use SQL functions in a formula field default