im using record.transform and then calling save i...
# suitescript
s
im using record.transform and then calling save if it fails how can i get the error for why it failed
Copy code
var id = fulfillmentRecord.save();
n
wrap it in a try catch and log the error
s
i was trying that
Copy code
try {
      var id = fulfillmentRecord.save();
      log.debug({ title: "created", details: id });
    } catch {
      log.error({ title: "failed", details: id });
    }
n
nah
catch(e){ log.error({title"Failed to save",details:e.message||JSON.stringify(e),||"No Meaningful message"}) }
Your catch you're actually specifying the message you want to see rather than the actual error.
s
yeah i knew it was wrong wasnt sure how thanks
👍 1