Focal Point
[CLOSED] Date validation using calendar control with App Studio

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5357080786

June 28, 2017, 09:10 AM
jfr99
[CLOSED] Date validation using calendar control with App Studio
Hi All,

I created a calendar control and set the "Selection & Validation" property to "Required/validate". When I enter an invalid date and move off the calendar field ... I get a popup window saying there is an error and the calendar field is hi-lighted ... but if I leave it as is and hit my Run Report button ... the invalid date goes to my report as a bad date. How do I get the calendar field to re-validate when I hit my Run Report button so the invalid date doesn't go to my report? FYI - I'm on version 8.2.01M

Thanks
~Jim

This message has been edited. Last edited by: FP Mod Chuck,


WebFocus 8.201M, Windows, App Studio
June 28, 2017, 09:36 AM
MartinY
jfr,

My suggestion when using calendar control is the set the Read Only property of the control to "Read only".
That way you avoid the possibility of an invalid manual date entry and avoid to re-validate the date before execution.
When you leave the ability to enter a date manually, you need to validate the date (is it a valid date), its separator (with or without dash, slash, ...) and format (is it MMDDYY, DDMMYY, YYMMDD, ...).
The format is the worst thing to validate : when the user enter 06/05/12, is it the date for June 5, 2012 or May 6, 2012 or May 12, 2006, ... ?

Reason why I forced user to select from the calendar control and not manually enter date. That way I know how the date will be returned to my fex.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
June 28, 2017, 09:43 AM
jfr99
Hi MartinY,

Yes, I agree with you on that but my requirement is to let the user input the dates as well as picking from the calendar. I was hoping there was a setting to make the dates get re-validated after I hit the Run Report button and before my report is executed. How do I make that happen?


WebFocus 8.201M, Windows, App Studio
June 28, 2017, 12:06 PM
jcannavo
Probably going to have to leverage javascript.

Here's a thread that may shed some light for you:
http://forums.informationbuild...821034762#8821034762


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
June 28, 2017, 01:24 PM
MartinY
As JC mentioned, you won't have choice to add java date validation in your run button function.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007