Marty Zigman

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

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 LinkedIn

Marty Zigman

Holding three official certifications, Marty is widely recognized as a top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. A former Deloitte & Touche CPA and technology executive with CTO roles, he brings over 35 years of leadership in ERP, CRM, and eCommerce business systems. Contact Marty to engage directly.

BiographyYouTubeLinkedInX (Twitter)

One thought on “Gotcha: SuiteScript 2.0 Checkboxes

  1. 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?

    Reply

Leave a Reply

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