This topic contains 3 replies, has 0 voices, and was last updated by CREECE 7 years, 10 months ago.

  • Author
    Posts
  • #1282

    slarsen

    So cannot really see anything wrong with this, but it throws an error:

    {“type”:”error.SuiteScriptError”,”name”:”SSS_MI SSI NG_REQD_ARGUMENT”,”message”:”Field.addSelectOption : Missing a required argument: options.value”…

    Trying to add an empty value option at top of my options list. Here’s the code. Operator error or bug?

    Code:
    fld.addSelectOption({
    value : “”,
    text : “-Select an Option-“,
    isSelected : false
    });
    And BTW, the code below works! So addSelectOption in 1.0 allowed an empty option value. Seems addSelectOption in 2.0 does not.

    Code:
    fld.addSelectOption({
    value : ” “,
    text : “-Select an Option-“,
    isSelected : false
    });
    This is a cached copy. Click here to see the original post.

  • #1283

    JayDP123

    The second example has a space between the quotes, the first one does not. Does that have anything to do with it?

  • #1284

    slarsen

    Yes, that’s my point. A non-empty value works, but an empty value throws an error

  • #1285

    CREECE

    I had this issue when trying to store values in the N/cache module. I wasn’t able to store a null/undefined/NaN/empty string. I had to stringify the value (JSON.stringify(”) for example) and when I read the value, JSON.parse it. Since everything was now stringified, it was valid and when parsed returned a valid value as well.

You must be logged in to reply to this topic.