Marty Zigman - The NetSuite Expert

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

Prolecto Labs Accelerator Templates

Gotcha: SuiteScript 2.0 Checkboxes

NetSuite Technical

Tags: , ,

This article is relevant if you are a SuiteScript developer working with the new SuiteScript 2.0 API.

Data Handling with Checkboxes

In recent work with SuiteScript 2.0, one of my senior consultants discovered the following when working with Checkboxes server side:

  1. Edit Mode: BeforeLoad UserEvent:  Checkboxes return the familiar: “T” and “F”.
  2. View Mode: BeforeLoad UserEvent:  Checkboxes return the a JavaScript boolean based true and false.
For example, context.newRecord.getValue(“isperson”) on the Customer record is providing different values depending on the mode.  If the context.type === context.UserEventType.EDIT, then context.newRecord.getValue(“isperson”) returns “T”.  However, if context.type === context.UserEventType.VIEW, then the same function call will return a Boolean TRUE.
I suspect this will be enhanced in due course as the API stabilizes.   In the meantime, enhance your code to handle these cases.

Learn the SuiteScript 2.0 API

We are doing a bunch of new work with the SuiteScript 2.0 API and there are some new features that show that NetSuite is committed to the new model.  The paradigm is different from SuiteScript 1.0 and don’t be surprised if you are not productive at first; all of us feel discomfort when we learn.  If you are interested in any custom NetSuite development, let’s have a conversation.

 

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

More Posts - Website - Twitter - Facebook - LinkedIn - YouTube

About Marty Zigman

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

Biography • Website • X (Twitter) • Facebook • LinkedIn • YouTube

One thought on “Gotcha: SuiteScript 2.0 Checkboxes

  1. Rob Klaproth says:

    This is VERY useful, unfortunately neither of these work for updating an existing checkbox via the API. I’ve tried T, F, TRUE, FALSE, YES, NO and none of those work. Any ideas how you can update a checkbox in netsuite such as is1099eligible from the vendor record via API?

Leave a Reply

Your email address will not be published. Required fields are marked *