I create a page where users select two dates, now we want to display the gap between two days.
Appointment Date: "user select the calendar" -Input
Re leaving Date :" User Select the calendar- Input
Working Date: " Re leaving Date-Appointment Date"-should be populate automatic.
How and where we have to write the code??????
Please explain details.
simply calculate enddate-startdate. you get the number of days as result.
Write code in OnValidate() trigger of the field in page. If these are table fields, you may write code OnValidate() trigger of fields in the table.
For, Working Date = " Re leaving Date-Appointment Date", here goes the code,
Re leaving Date - OnValidate()
IF ("Re leaving Date" <> 0D) AND ("Appointment Date" <> 0D) THEN BEGIN
IF ("Re leaving Date" > "Appointment Date") THEN
"Working Date" := ("Re leaving Date" - "Appointment Date")
ERROR('Re leaving Date must be greater than Appointment Date');
Appointment Date - OnValidate()
Note that "Working Date" is not a date, it must be an integer for the above code to work. If you need your result as a date then some more code is required.
It is working bro....
thank you.......From the bottom of my heart .
Hi Nabin, You're welcome. :)
Please verify the solution and don't forget to verify solutions in future as well whenever you get the solution to your issues in dynamicsuser.net
Thanks Once again.
Nabin Kumar Sinha