I'm trying to update an inbound shipment and getti...
# suitescript
s
I'm trying to update an inbound shipment and getting a non-helpful error
Copy code
record.submitFields({
        type: record.Type.INBOUND_SHIPMENT,
        id: data.id,
        values: {
          custrecord155: shipdata[0].LiveMapUrl,
        },
        options: {
          enableSourcing: false,
          ignoreMandatoryFields: true,
        },
      });
error fyi custrecord155 is a hyper link and the data is a string
Copy code
{
   type: "error.SuiteScriptError",
   name: "UNEXPECTED_ERROR",
   message: "An unexpected SuiteScript error has occurred",
   stack: [
      "Error\n    at suitescript/resources/javascript/record/recordImpl.js:156:24\n    at Object.submitFields (suitescript/resources/javascript/record/recordImpl.js:154:30)\n    at Object.map (/SuiteScripts/inboundshipment/updateTracking.js:54:14)"
   ],
   cause: {
      type: "internal error",
      code: "UNEXPECTED_ERROR",
      details: "An unexpected SuiteScript error has occurred",
      userEvent: null,
      stackTrace: [
         "Error\n    at suitescript/resources/javascript/record/recordImpl.js:156:24\n    at Object.submitFields (suitescript/resources/javascript/record/recordImpl.js:154:30)\n    at Object.map (/SuiteScripts/inboundshipment/updateTracking.js:54:14)"
      ],
      notifyOff: false
   },
   id: "",
   notifyOff: false,
   userFacing: true
}
t
make sure your id is integer and/or not null make sure your shipdata[0].LiveMapUrl not null
s
Yes checked both of those
s
perhaps hyperlink field is not inline editable, did you try loading/settings instead?
e
I've seen this in two cases; one where the id is a float (1234.0) and not an int, so I moved to strings, and another on a certain record type, can't recall which, but record.load/save worked
s
this is a string it needs to be int ?
Copy code
data.id
e
We received this error this morning during processing an M/R, there is a defect assigned to it
s
it seems to work if i do record.load/record.save which is longer and more computed power
s
Sometimes, there are also scenarios when you can use record.submitFields but it actually does a save/load behind the scenes because the field is not inline editable