Im trying to use record.submitFields to set a cust...
# suitescript
t
Im trying to use record.submitFields to set a custom body text field on a sales order and something isn't working. I get the id back, no errors are thrown, but the value isn't set. Anyone ran into anything similar?
Copy code
var update = require(['N/record'], function(ns_record) {
        //var so_id = '124025'; // test
        var so_id = '1751676'; // live

        var id = ns_record.submitFields({
            type: 'salesorder',
            id: so_id,
            values: {
                custbody_email_template_to_send: 'test'
            }
        });
        console.log('id', id);
    });
b
code looks normal
might want to make sure there are no scripts or workflows modifying its value
t
It’s a new field (20 min old) so nothing’s running against it. I’ll hit it again in the morning and see if it makes any more sense. I’d almost bet there is a cache in the middle somewhere that ignores requests by the browser to clear cache...
s
double check your field internal id and the browser is only partially reliable in my experience for testing such things.
p
I've forgotten to do "store value" before, that's always a possibility 😄
t
So after a dozen or so different tests the final fix was to change the internalid of the custom field... this of course fixed nothing but got me past whatever was giving NetSuite a headache. Maybe an ID length issue???