razer456
11/24/2021, 6:03 PM{
type: "error.SuiteScriptError",
name: "INVALID_FLD_VALUE",
message: "Invalid date value (must be MM/DD/YYYY)",
stack: [
"anonymous(N/serverRecordService)",
],
cause: {
type: "internal error",
code: "INVALID_FLD_VALUE",
details: "Invalid date value (must be MM/DD/YYYY)",
userEvent: null,
stackTrace: [
"anonymous(N/serverRecordService)",
"anonymous(N/serverRecordService)"
],
notifyOff: false
},
id: "",
notifyOff: false,
userFacing: false
}
whyyy?????battk
11/24/2021, 6:07 PMbattk
11/24/2021, 6:07 PMbattk
11/24/2021, 6:08 PMbattk
11/24/2021, 6:08 PMrazer456
11/24/2021, 6:19 PMvar formattedDateString = format.format({
value: parsedDateStringAsRawDateObject,
type: format.Type.DATE
});
//else usageDateFinal = dtUsageDate;
log.debug("usageDateFinal before set on record", formattedDateString);
objUsageVal["usagedate"] = formattedDateString;
// Customer, Item and Subscription Plan will be automatically sourced
this is the code just before thatbattk
11/24/2021, 6:20 PMobjUsageVal[fld]
a string or a Date?razer456
11/24/2021, 6:20 PMbattk
11/24/2021, 6:21 PMrazer456
11/24/2021, 6:21 PMrazer456
11/24/2021, 6:21 PMbattk
11/24/2021, 6:21 PMformattedDateString
suggests you thought it was a stringrazer456
11/24/2021, 6:22 PMrazer456
11/24/2021, 6:22 PMbattk
11/24/2021, 6:22 PMrazer456
11/24/2021, 6:23 PMbattk
11/24/2021, 6:23 PMbattk
11/24/2021, 6:24 PMrazer456
11/24/2021, 6:25 PMrazer456
11/24/2021, 6:25 PMrazer456
11/24/2021, 6:25 PMrazer456
11/24/2021, 6:25 PMbattk
11/24/2021, 6:26 PMrazer456
11/24/2021, 6:26 PMbattk
11/24/2021, 6:26 PMobjUsageVal[fld]
is a string or Datejen
11/26/2021, 11:02 PMformat.format
? If you are using setValue, just pass it a date object. No need to format it.