This topic contains 3 replies, has 0 voices, and was last updated by roberth 6 years, 6 months ago.

  • Author
    Posts
  • #17938

    roberth

    I’m trying to set the values of some custom segments on a custom record that we’ve created. I am able to set the values using SuiteTalk without issue, however when trying to set the values using SuiteScript 2.0 I am unable to get them to save. Either the value is blank or I get an exception saying invalid value (which is a valid value for the field)

    Here is my current code:

    Code:
    var brand = returnAuthRec.getSublistValue({
    sublistId: ‘item’,
    fieldId: ‘custcol_cseg_rr_brand’,
    line: i,
    });

    var returnReasonRecord = record.create({
    type: ‘customrecord_return_reason’,
    isDynamic: false,
    });

    returnReasonRecord.setValue({
    fieldId: ‘custrecord_1682_cseg_rr_brand’,
    value:returnAuthRec.getSublistValue({
    sublistId: ‘item’,
    fieldId: ‘custcol_cseg_rr_brand’,
    line: i,
    }),
    ignoreFieldChange: true,
    });

    returnReasonRecord.save();
    This is a cached copy. Click here to see the original post.

  • #17939

    roberth

    So it seems that custom segments have different default permissions of view rather than edit. Changing the permissions resolved.

  • #17940

    reptar

    There shouldn’t be a comma after the last field in a JSON object. I don’t understand how this works.

  • #17941

    roberth

    Actually trailing comma’s have been supported by JS for a long time. Specifically for objects since ES5 (which NetSuite supports). See https://developer.mozilla.org/en-US/…railing_commas

You must be logged in to reply to this topic.