Validating Time

Less than one minute read time.

A way of validating time is possible by taking advantage of the way Date/Time fields are added into Sage CRM.

For example if you add a new Date/Time field into the company table, e.g. comp_customersincedate there is a lot of additional functionality added when the field is included in a screen (like companyboxlong). Some of this functionality is associated with the control of the popup calendar and its positioning on the screen.

But there are also extra hidden fields added to the HTML form.

<input type=hidden name="comp_customersincedate_HOUR" ID="comp_customersincedate_HOUR" value="">
<input type=hidden name="comp_customersincedate_MINUTE" ID="comp_customersincedate_MINUTE" value=""><input type=hidden name="comp_customersincedate_AMPM" ID="comp_customersincedate_AMPM" value="">
<input type=hidden name="_HIDDENcomp_customersincedate_TIME" ID="_HIDDENcomp_customersincedate_TIME" value="">

A Validation rule can then access this information to allow you to build time checks