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 4, 2011, 5:18 PM
3 Posts

First steps : Date field validation

  • Category: Other Domino Designer Tooling
  • Platform: Windows
  • Release: 8.5
  • Role: Developer
  • Tags: Date falidation
  • Replies: 3
Hi everybody,
I'm moving the first steps with Xpages, so it's possible this will sound ane easy question for most of you but I didn't find a way to sort it out.
I've an xpage (with the bind to a doc) where I need to validate dynamically a date field, checking if it' at least one month in the future.
In a previous release form I wrote a validation formula like this:
@If(
  @Adjust(datefield;0;-1;0;0;0;0)<@today;
      @Failure("Date is not valid");
      @Success
but I don't understand how to write it (or an equivalent) in the xpage validation property. 
Can you pls help?
 
Thanks in advance
Fabio
 
Apr 4, 2011, 5:45 PM
13 Posts
Re: First steps : Date field validation
 ok, in the validation tab you have a a minimum and a maximum, if you compute it it looks for a date time value, so you could do a 
 
session.createDateTime(@Now())
Apr 4, 2011, 6:21 PM
22 Posts
Re: First steps : Date field validation
You need to set the validator values for both the minimum and maximum to work, so do a furmula for the minimum like this:
 
@Adjust(@Today(), 0, -1,0,0,0,0);

And then set the maximum to something way out of range like 3001/01/01
 
Set the error message to something understandable like "Date is not valid / must be one month ago or newer."
 
Good coding

Newbs
Apr 4, 2011, 8:47 PM
13 Posts
Re: First steps : Date field validation
 I get it to work without a maximum

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