Wednesday, February 20, 2019

Getting "no method 'getTime'" Error

There are instances where a user would like to get the time related to a certain date by using getTime(), but they are getting an error "no method 'getTime'" when using the said method.

If the user is to get the date on a date or datetime field from a record such as that of startdate or lastmodifieddate, the string output from nlapiGetFieldValue() needs to be converted first to a date using nlapiStringToDate().

Below is a sample code:

If the user is to get the date via getting the current date, it is important that the Date() is instantiated.

Below is a sample code:

If the said notes were not followed, the error "no method 'getTime'" will be thrown.

No comments:

Post a Comment