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



Apr 9, 2013, 11:39 AM
47 Posts
topic has been resolvedResolved

Creation Date

  • Category: Debugging
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: date field
  • Replies: 4
Hi everyone,

 Something strange is happening.  On a Notes form I have a field "expenseDate" with a formula of @Now.  On my XPages, I put the same formula.  When i created a document, no mater what time i created, the date is today's date but the time never change. 

No matter what formula I use for the field - @Now(), @Created(), @Today(), @Date(@Created)), etc. - the cient is always showing 08:00:00 AM when I create a document on the web.  Furthermore, the log is showing this:

04/09/2013 09:35:45 AM HTTP JVM: expenseDate = 4/9/2013 12:00 PM which means that 08:00:00 AM is translated to 12:00 PM.

To verify this, I create a doc on the client and the time is OK.  There is a validation in the field that the date must not be in the future, so when I try to open the document created on the web from the client, I receive an error that it must not be in the future (12:00 PM is in the future).
 

I don't know how to fix that, any idea?  

   
Apr 9, 2013, 2:14 PM
586 Posts
Re: Creation Date
 What happens if you try and use SSJS?


var newDate:NotesDateTime = session.createDateTime(“Today”);
newDate.setNow()
newDoc.replaceItemValue(“dateField”, newDate); 


That's from the xpagescheetsheet.  I would try that in an event after your document is available...  

See if that behaves better. 


Dave 
Apr 9, 2013, 6:16 PM
47 Posts
Re: Creation Date
Hi Dave,

I put the code in the "after page load": 

  
var newDate:NotesDateTime = session.createDateTime('Today');
newDate.setNow()
document1.replaceItemValue('expenseDate', newDate);
var codeValue = getComponent("inputCode").getValue();
viewScope.CodeKey = codeValue;

but no change :-( 


  
Apr 9, 2013, 7:10 PM
586 Posts
Re: Creation Date
 Danyele,


I just want to an app I have.  XPages.TV.   I added a date field to the notes form.  Just a date field.  no default formula or anything. 


I want into an xpage where I can create documents and added a computed field control and bound it to the date field from the form.  I set it to display the Date and Time. 


In the postNewDocument event of the data source I added this: 

   authorDoc.replaceItemValue("dateCreated", @Now());

This gave me date with time and saved the time value to the backend notes document. 

I changed the computed field to use date time picker and set it to show both and that seemed to work ok as well. 

You are using a date field on the notes forum?  are you using the datepicker?  something else like the dojo version? 

What's different between your use case and mine?
 

Dave 

 

 
Apr 10, 2013, 10:30 AM
47 Posts
Re: Creation Date
Hi Dave,

 
In the Notes form I am using a Date/Time field editable with a Calendar/Ttime control  having a default value of @Now.

In the XPages I am using an Edit Box control Date/Time with a date/time picker pop-up with a default value of @Now()

I am putting what you said in the postNew Document of the XPage: document1.replaceItemValue("expenseDate", @Now());  and I changed the display to date and time.  

It's a miracle, it's working :-) 

Thank you very much for your help  

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