Search code examples
sortinglotusscriptlotus

Lotus sorting view on orderdate does not work properly


I have created a view in which I also have a column which holds dates. This column can be sorted on ascending and descending. This is my column properties value:

enter image description here

But the problem is that the view does not sort the dates properly:

enter image description here

And here a screenshot of the orderdate field itself:

enter image description here

And here screenshot of the document with the orderdate that is out of order in the view:

enter image description here

Update

Some documents had the orderdate as text instead of date.. I create these documents through a java agent. The field orderdate I fill in like this:

SimpleDateFormat formatterDatumForField=new SimpleDateFormat("dd-MM-yyyy");
docOrder.replaceItemValue("Orderdatum",formatterDatumForField.format(currentDateForField));

But it is saved as text instead of date. Anyone knows why?


Solution

  • Problem was that orderdate field was set by a backend agent and this field was set with a string.

    I know saved the current time as a DateTime object and now it works:

     DateTime timenow = session.createDateTime("Today");
     timenow.setNow();
    
     docOrder.replaceItemValue("Orderdatum",  timenow);