Validation Message

  • 29 July 2016
  • 1 reply
  • 0 views

Badge +4

I'm working a solution to display a message to a user when a control they are working on has invalid data. For this example I have a Start and Due Date, where the Due Date cannot be before the Start Date. I also have a data label that will contain the message I want to display

 

Sample 1:

Using True/False I would use a rule to set the visibility of the data label

14553i71830AFE519ABB8B.png

 

 

Is there a more elegant method for displaying messages?


1 reply

Userlevel 1
Badge +8

Hi Jason

 

There are 2 ways I would approach this, both implement the same logic.

 

1. On the Change events for the date text boxes (Due Date and Start Date)

 

Create a rule on the Due Date change event. Add an advanced condition that checks the Due Date is less than the Start Date. Also add a condition that the Due Date contains a value. If both conditions evaluate to true then show a message to the user (e.g. Due Date cannot be before Start Date) and then add a data transfer to clear the Due Date (just tick the box and leave the value empty)

 

Then do the converse for the Start Date.

 

2. On the form submit

 

Add the same advanced condition as above and show a message if it is true. Instead of clearing the values with a data transfer just add a statement to stop the rule execution.

 

 

11160i817C16372962FF7F.png

 

 

If you want to use data labels to display warning instead of messages just hide/show your warning data label instead of showing the message box.

 

 

 

Reply