I'm trying to set a Date field value on a line ite...
# suitescript
t
I'm trying to set a Date field value on a line item in SS2.0 - I'm using the format module to take a value from an existing date field and copy it to a line item date field. When I log the date, it looks to be formatted fine, but when I go to set the value I get the error message of "Invalid date value (must be M/D/YYYY)". Any idea on how to move past this?
n
Are you updating/setting the value in Client/server side scripts? One thing, if you are using setValue, you can pass in date object and you don't need to use format module. i.e. getValue -> convert to Date Object( new Date(DATA_VALUE)) -> setValue(PARSED_DATE_OBJ)
t
I was setting the value in a User Event afterSubmit script. I was making the mistake of trying to format the date after pulling it from a different NetSuite date field - when I stopped trying to format and just set the value as it was, it worked just fine. Thanks for your comment!