I’m trying to set a DateTime field using the setDateTimeValue method. It works fine when the user’s preferences for date format is mm/dd/yyyy and time format is hh:mm AM/PM, but if the user executing the script has any other formats picked in their preferences (i.e. 24 hour time format for example) it does not appear to work – an invalid argument error is returned. I’ve tried making sure that the same format is always entered to the method, and I’ve also tried matching the format to the user’s preferences but it does not seem to matter. Does anyone have a trick, suggestion or confirmation that it is a bug?
example:
var caseRec = nlapiLoadRecord(‘supportcase’,caseId);
soRec.setDateTimeValue(‘custevent_early_eta_dt_crm ‘,’10/06/2016 10:00:00 am’,5);
This works fine with the user preferences set for m/d/yyyy hh:mm am/pm, but as soon as you change your preferences to anything else it yields:
You have entered an Invalid Field Value 10/06/2016 10:00:00 am for the following field: custevent_early_eta_dt_crm
Thanks!
Mike
This is a cached copy. Click here to see the original post.