Can't seem to get my Date type field to accept my new date value. It doesn't throw any errors; it just appears to ignore the setValue function. If I set the date in the UI, a script log will show the following format:
{"details": datetypeField = Thu Oct 25 2018 00:00:00 GMT-0700 (PDT)"}
Any help would be greatly appreciated.
/**
* @NApiVersion 2.0
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define(["N/record", "N/format"], function(r, f) {
var customer = r.load({
type: r.Type.CUSTOMER,
id: "111",
isDynamic: false,
});
var today = new Date();
customer.setValue({
fieldId: "custentity_datetypefield",
value: today
});
customer.save({
enableSourcing: true,
ignoreMandatoryFields: false
});
});