cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use rules to prevent deadlines less than today?

Hi all

 

Still a fairly new user and self-learning fast - but I don't know how to use rules in nintex and how to create formulas for them?

 

I have a field 'deadline' in a form - we want to investigate if its possible for nintex to prevent users selecting a date less than today/current date? It doesn't make sense to allow them to pick a deadline of yesterday or less! Sorry if this is a silly question or has been asked before - I did a search but couldn't find anything quite in this vein

 

Thanks from NZ!

Tamina

Labels: (2)
Tags (1)
0 Kudos
Reply
15 Replies
xMikeX
Automation Master
Automation Master

Re: How to use rules to prevent deadlines less than today?

Hello

Proposed Solution:

a)

Select your date control on the form.   Then add a rule to it using the form's rule box and select the type of rule as Validation.  Use the following code:

{Self} < Current Date

Type the message you want displayed when the date is invalid.

0 Kudos
Reply
michellepm
Nintex Newbie

Re: How to use rules to prevent deadlines less than today?

Hello

Assuming that I want to validate the start and end date

meaning I want the end date to not be less than the start date (example : start date = 24-10-2014 and the end date cannot be less than that date)

Will my validation code be something like this:

Control is invalid if : LessThan(End date, Start date)

Am I correct?

Would appreciate your help

Thanks in advance

0 Kudos
Reply
xMikeX
Automation Master
Automation Master

Re: How to use rules to prevent deadlines less than today?

You could achieve the same thing with the code I posted above, only instead of "Current Date" use either the Start Date or the End Date reference fields and use either "<" or ">" depending on which of the controls you plan to put the validation on.  For example, if you put the validation on the End Date you could do something like {Self} > Start Date throw a validation error, because End Date would be greater than the Start Date.

0 Kudos
Reply
Not applicable

Re: How to use rules to prevent deadlines less than today?

Thanks mmatsako - I ended up finding the rule a bit difficult as I couldn't select 'validation' as a rule type and I also couldn't seem to access the message field. Not sure why.

I instead used your suggestion from the linked post around the validation settings under the configuration controls for the Date/Time picker - this worked well thank you. Always good to learn something new and so simple too! Many thanks

 

"Another way you can get this to work is under the Validation section of the configuration page for the Date/Time picker control on your Nintex Form is to set "Use range validation" to Yes.

For Minimum value, type in a date that was in the past such as "01/01/2014" or go back further if needed.

For Maximum value insert the reference of Current Date from under the common tab.

This should allow you to pick a date in the past or today, but not beyond"

0 Kudos
Reply
xMikeX
Automation Master
Automation Master

Re: How to use rules to prevent deadlines less than today?

Glad it helped!  The reason you might not have been able to select Validation is because it was only released in a recent version. 

Validation Rules were introduced in Nintex Forms released on 5th June 2014.

Nintex Forms 2013 v2.3.2.0

Nintex Forms 2010 v1.5.2.0

0 Kudos
Reply
Not applicable

Re: How to use rules to prevent deadlines less than today?

I have implemented the same but what happens, It works perfectly fine in new mode but in edit mode, if user wants to change some other field the start date starts throwing error that "Start Date cannot be less than todays date.

How we can make sure that this validation rule should work only in New Mode?

I have earlier version of nintex which doesn't have Validation Rules Tab

Thank you in advance.

0 Kudos
Reply
Not applicable

Re: How to use rules to prevent deadlines less than today?

I have the exact same issue.  The rule works perfectly in new mode, but later if the form is edited past the "Start Date" it gives the same validation error.  How do you only run the rule if its a "new form"?

0 Kudos
Reply
Not applicable

Re: How to use rules to prevent deadlines less than today?

Thank you for selecting a "correct answer," Tamina!

0 Kudos
Reply
Not applicable

Re: How to use rules to prevent deadlines less than today?

Frank,

Would you know an answer to the issue that Ashish and myself are having below regarding the determination if the form is in "New Mode" before applying the rule?

0 Kudos
Reply