Thursday, May 16, 2019

Why are arguments passed to User Event functions of type Object and not string

When evaluating typeof() on User Event arguments, Object type is returned for string values.

For example as shown on the following image, when calling typeof(type) where "type" is one of the User Event script function arguments, typeof() returns object and not string:

This is because arguments passed to User Event functions by NetSuite are instances of String object and not string variables. This is also described here:

To check whether a variable is a string or not, following code can be used:

No comments:

Post a Comment