I'm getting an inconsistent error; ``` type: "erro...
# suitescript
e
I'm getting an inconsistent error;
Copy code
type: "error.SuiteScriptError",
   name: "INVALID_NUMBER",
   message: "Invalid number 4427280.0",
Calling method;
Copy code
static updateRecord(id, values) {
    record.submitFields({
        type: record.Type.INVOICE,
        id: parseInt(id),
        values: values,
        ignoreMandatoryFields: true,
        enablesourcing: false
    });
};
Has anyone seen something like this before?
n
What's the field type you're trying to submit to?
If it's a custom field, have you checked its validation settings?
e
It's the record id that is throwing the error.
n
try parseInt(id,10)
e
Thanks, I'll give that a shot. Odd that it's inconsistent with the same call, but I'm not surprised
n
if that fixes it, the why here is Javascript Wat. with only one argument, parseInt tries to interpret what to do based on the format of the input string - if it starts with a 0, it tries to parse it into a base 8 number instead of a base 10. By specifying the radix with the second argument, you ensure that parseInt will always try to convert to a base 10 number. I think this is fixed with 2.1's JS version, but I've been in the habit of using parseInt(x,10) because of being bitten by that Wat one too many times
e
I appreciate the explanation. Thanks!