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 22, 2016, 4:50 PM
2 Posts

Need help with a computed field

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0
  • Role: Developer
  • Tags: computed field
  • Replies: 1

var d = document1.getItemValueDate("lastMaintRep1");
if(d == null) {
 return "date is empty or doesn't exist."
} else {
 return d.toLocaleString();

 

I have a computed field on an xpage that does not want to work!!

 

Not sure what I am doing wrong

 

The xpage has a date field lastMaintRep (last maintenance report date in real life)

I have another field with number of days until the next maintenance is due (field name is Frequency)
 

I need a computed field to show the date of the next due maintenance by taking the last date and adding on the frequency (in days) @ adjust etc

 

Thanks

 

 

 

 

 

Apr 25, 2016, 2:10 PM
6 Posts
get the notesdatetime

I think you just have to get the notesdatetime... something like

var ndt = document1.getItemValueDateTime("lastMainRep1");

if(ndt.getDateOnly()==""){return null;}

var freq = document1.getItemValueDouble("Frequency");

var newdt = @Adjust(ndt.getLocalTime(),0,0,freq,0,0,0);

//convert to java date for display formatting

var jdt = newdt.toJavaDate();

jdt


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