Hi,
I have a two Datepicker control(startdate and EndDate) and there is a Label ErrorMessage3 and LabelErrorMessage4 in two different DataCards.
I need to validate Datepicker Control with two Conditions and with different error messages need to display by default visible is false for ErrorMessage3.
1)StartDate Datepicker control should not be greater that EndDate Datepicker control
Ex: ErrorMessage3: StartDate should not be greater than EndDate
2)For Startdate and EndDate should not select future dates
Ex:ErrorMessage3: Future dates should not be selected
My question is how to display error message based on condtion and how to Make ErrorMessageVisible true.I have tried creating a context variable I have written code in below Text property of ErrorMessage3
Solved! Go to Solution.
You've got some general syntax errors in your formula. Check your paren's and notice that you are missing some.
That's first.
Second - you can't use a statement like UpdateContext in the property like that. That's a behavior statement.
Now...
What you want to look at is both the text property and the visible property of the ErrorMessage3 label.
What your label says is what is in the Text property -
If(DataCardValue3.SelectedDate>Today(), "Future Dates cannot be selected", DataCardValue3.SelectedDate>DataCardValue4.SelectedDate, "Not greater than End Date")
When you see the label is based on the Visible property -
(DataCardValue3.SelectedDate > Today() || DataCardValue3.SelectedDate > DataCardValue4.SelectedDate)
Hope that helps.
You've got some general syntax errors in your formula. Check your paren's and notice that you are missing some.
That's first.
Second - you can't use a statement like UpdateContext in the property like that. That's a behavior statement.
Now...
What you want to look at is both the text property and the visible property of the ErrorMessage3 label.
What your label says is what is in the Text property -
If(DataCardValue3.SelectedDate>Today(), "Future Dates cannot be selected", DataCardValue3.SelectedDate>DataCardValue4.SelectedDate, "Not greater than End Date")
When you see the label is based on the Visible property -
(DataCardValue3.SelectedDate > Today() || DataCardValue3.SelectedDate > DataCardValue4.SelectedDate)
Hope that helps.
Thanks for the reply!
It's working fine.
User | Count |
---|---|
139 | |
132 | |
75 | |
72 | |
69 |
User | Count |
---|---|
213 | |
200 | |
64 | |
62 | |
54 |