Any idea why I might be getting an INVALID_NUMBER ...
# suitescript
w
Any idea why I might be getting an INVALID_NUMBER on a
record.save()
? It's adding a decimal and a zero after the decimal. So instead of 11612, it's 11612.0 . I start by doing a
record.load()
with the 11612 as my
id
. Then
setValue
on a bunch of fields, and my log.debug shows this working. Then it hits the
record.save()
and I get the error.
j
What is the full error message
w
Copy code
{
  "type": "error.SuiteScriptError",
  "name": "INVALID_NUMBER",
  "message": "Invalid number 11612.0",
  "stack": [
    "anonymous(N/serverRecordService)",
    "post(/SuiteScripts/Sansom Scripts/testRestlet.js:147)"
  ],
  "cause": {
    "type": "internal error",
    "code": "INVALID_NUMBER",
    "details": "Invalid number 11612.0",
    "userEvent": null,
    "stackTrace": [
      "anonymous(N/serverRecordService)",
      "post(/SuiteScripts/Sansom Scripts/testRestlet.js:147)"
    ],
    "notifyOff": false
  },
  "id": "",
  "notifyOff": false,
  "userFacing": false
}
b
i say sidestep the issue, use the string '11612' as the id
j
Yeah in my experience I have to set all numeric values as strings when using the 2.0 API.
w
Ok.. I'll give that a try.. Thanks