Gotcha: SuiteScript 2.0 Checkboxes

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.


Be Sociable, Share!

Marty Zigman

Holding all three official certifications, Marty is Southern California's 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 25 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 - Google Plus - YouTube

| Tags: , , | Category: NetSuite, Technical | Leave a comment

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>