This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jan 29, 2018, 8:20 PM
68 Posts

error using adjustDay in Javascript

  • Category: Debugging
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 1

I have a server Javascript library where I am re-writing a LotusScript agent in Javascript, so I can keep all the code in one place.  I need to adjust dates, and am attempting to use adjustDay, but it's just not working.  What is wrong with the following?

var lastdate:NotesDateTime = session.createDateTime(@Today());

lastdate = doc.getItemValue("LastDate"); // I have a handle on doc

lastdate.adjustDay(days)  // where days = an Integer;

I'm getting: "Error calling method 'adjustDay(number)' on an object of type 'java.util.Vector [Dynamic Java Wrapper, java.util.Vector]'

When I try lastdate:NotesDateTime = doc.getItemValue("LastDate") I also get an error on adjustDay

Jan 30, 2018, 10:20 AM
2 Posts
getItemValue does not return a NotesDateTime object
Instead, it returns a Vector, as the error message suggests.

You could try this instead:

var lastDateItem:NotesItem = doc.getFirstItem("LastDate");
if (lastDateItem != null && lastDateItem.Type == 1024) { //where 1024 == NotesItem.DATETIME
        var lastDate:NotesDateTime = lastDateItem.getDateTimeValue();
        lastDate.adjustDay(days);
        //...
}

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal