Resources / Article
SuiteScript 2.x: disable a sublist field
How to turn a sublist column or field off in NetSuite, using the custom form Screen Fields setting, a SuiteScript example, or mobile page conditions.
A sublist column is switched off on the custom transaction form, on the Screen Fields subtab. Oracle's documented scripting example for field editability is a tutorial that locks the tax fields on sales transactions in U.S. accounts (Oracle help).
The asker on Stack Overflow titled the thread:
"Disable NetSuite Sublist Field Via SuiteScript" (Stack Overflow)
Can you disable a sublist field from SuiteScript?
The Screen Fields subtab on a transaction form carries a Check Box Default column beside the Disable Transaction Dist. field. Selecting Checked there disables the SuiteApp-related fields on that custom form, and the default value in the column is Unchecked (Oracle help).
Oracle's scripting example for field editability is the Disable Tax Fields tutorial, which locks the tax fields on sales transactions in U.S. accounts (Oracle help). It is written for accounts on Legacy Tax with SuiteTax switched off, and it assumes the Per Line Taxes on Transaction preference is off for the U.S., with the tax fields placed as body fields on the Accounting subtab. It covers six transactions (invoices, sales orders, cash sales, cash refunds, credit memos and return authorizations), and editing the tax fields stays with Administrator and a few named roles. Whether it fits your record depends on the record type, the form, and the features enabled in the account.
Turn the column off on a custom transaction form
- Go to Customization > Forms > Transaction Forms.
- In the Custom Entry Forms list, open the form with Customize (a standard form) or Edit (a custom one).
- Open the Screen Fields subtab.
- In the Check Box Default column for the Disable Transaction Dist. field, select Checked.
- Click Save.
Oracle adds a note on the same page. After the transaction form preferences are enabled, existing custom forms need a TLD decision: turn the TLD fields on and clear the Disable TLD box where TLD is required, and tick the Disable TLD box where TLD stays off. A form left without that decision produces errors (Oracle help).
Use a script when the rule follows the record
The tax tutorial shows the shape of the work. Before you carry its approach onto your record, confirm the account matches what it assumes: Legacy Tax in use, SuiteTax switched off, the Per Line Taxes on Transaction preference not enabled for U.S., and the target field sitting as a body field on the Accounting subtab (Oracle help). The tutorial also lists which roles keep edit rights, with the Administrator role among them.
Sublist lines that carry a subrecord
Oracle gives three cases where a sublist line holds a subrecord: the inventory detail subrecord on a purchase order item line, the landed cost subrecord on a vendor bill line configured for landed cost per line, and address subrecords on an employee's Address sublist (Oracle help). The subrecord is reached through one field on the line, and the SuiteScript Records Browser identifies that field as type summary. The line also carries fields that sit outside the subrecord.
What mobile pages do
Mobile page elements carry their own settings. For buttons and some field elements you can set a Disable Field Condition, and a UOM page element can have the quantity subfield disabled on its own through Disable Condition for Quantity Only, or the unit subfield through Disable Condition for Unit Only (Oracle help). Those condition fields take a true or false value, and a dynamic value can be an expression that works out to true or false.
Custom mobile processes carry column settings such as Column Order, Is Visible By Default, Label and Visibility Condition, and UOM elements carry Display Order, Is Mandatory and Label (Oracle help). A consultant working on a mobile screen reads those settings on the element itself.
Example
A distributor in Pune raises purchase orders in NetSuite. The Items sublist has a custom column, custcol_handling_rate, holding rupees. The commercial rule is that the column stays off when the item comes from a lot, and stays open for everything else. See lot or serial inventory for how those items are set up.
Start with the form. Read the Screen Fields subtab on the purchase order form and note the current Check Box Default values. Make the TLD decision for every existing custom form before you save the preference change (Oracle help).
If the rule has to follow the data, the build follows the pattern in the tax tutorial: confirm the account's tax features and preferences, confirm the field's type in the SuiteScript Records Browser, then test on a saved purchase order and on a new one (Oracle help). A line for packing material at ₹4,500 keeps the column open. A line for a lot-tracked chemical at ₹2,40,000 falls under the rule.
Trade-offs
A form setting is a single checkbox saved with the custom form (Oracle help). A script built on the tax tutorial carries the assumptions listed there, so the account's tax features and preferences have to be checked before you rely on it (Oracle help). Mobile page elements carry conditions of their own, set on the element (Oracle help).
Common mistakes
Changing the transaction form preferences and leaving existing custom forms without the TLD decision, which Oracle says produces errors (Oracle help).
Copying the tax tutorial onto another record type without checking that Legacy Tax is in use and SuiteTax is switched off (Oracle help).
Assuming the desktop form setting covers the phone screen, when mobile elements hold their own conditions (Oracle help).
Leaving the rule undocumented. Record the field, the rule and the form in the BRD so the next consultant finds it.
FAQ
Can a script turn off a whole sublist column?
Column control is documented on the custom form, in the Screen Fields subtab (Oracle help). Oracle's field-editability tutorial works through transaction body fields (Oracle help).
Why did errors appear after a form preference change?
Every existing custom form still needs a TLD decision before you save the preference change (Oracle help).
How is a subrecord reached from a sublist line?
Through one field on the line, which the SuiteScript Records Browser identifies as type summary (Oracle help).
Where do I set this for a phone user?
On the mobile page element, through its Disable Field Condition, or through the quantity and unit conditions on a UOM element (Oracle help).
Which record types does the tax tutorial cover?
Six sales transactions: invoices, sales orders, cash sales, cash refunds, credit memos and return authorizations, on accounts that meet the tutorial's assumptions (Oracle help).
The quick way is mark.: it reads the client's NetSuite account read only, finds why the field behaves as it does, and tells you the exact fix to apply. Try it free.
Sources
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1015124816.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1525975256.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157174758775.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_161549215472.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_163614572439.html
- docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4675625582.html
Have mark. check this against the client's own files
mark. reads the client's files and sets each point against them, with the source beside it.
Twenty minutes on one client folder. Your 21-day trial opens on the call.