This topic contains 3 replies, has 0 voices, and was last updated by errol 8 years, 3 months ago.

  • Author
    Posts
  • #6201

    jmessersmith

    Code:
    nlapiSubmitField(‘salesorder’, searchresults[i].getId(), ‘custbodytracking_delivery_date’, nlapiStringToDate(’01/01/2011′));
    Is there a way to use nlapiSubmitField to change a datetime field? I’m getting UNEXPECTED_ERROR.

    Is the only other option using record.setDateTimeValue?
    This is a cached copy. Click here to see the original post.

  • #6202

    jmessersmith

    Nevermind, it was all a formatting problem. should be in this format: mm/dd/yyyy hh:mm:ss am|pm (for example, โ€˜09/25/2013 06:00:01 amโ€™).


    david.smith replied on 08/18/2016, 09:23 AM: Careful because each user can set their preferences to a different date format. See the other comments below for using nlapiStringToDate.

  • #6203

    k_dunc

    Just BTW, I think the issue probably was your use of nlapiStringToDate. It probably should have been nlapiDateToString.

  • #6204

    errol

    k_dunc is right. Also, for datetime fields, you could use nlapiDateToString(new Date(), ‘datetimetz’); The datetimetz will format it to work with the datetime fields. If you leave that out, it will format for normal date fields.

You must be logged in to reply to this topic.