Hello,
We have a form that is in production. One of the fields is a date field. However, in the schema it has a data type of text. I have been asked to add a rule that changes the font to red if the date value has expired; i.e., is less than the current date. Is this possible?
I have found that if I try to change the schema data type to date, and open the form with live data, that the form shows a dashed rectangle around the field with the message, "Only date allowed." The dashed rectangle and the message go away if I change the schema data type back to text.
So, I keep the schema as text. When I try to add the formatting rule, there is no way to convert the date as a text field to a date type. Too bad InfoPath doesn't allow type conversions.
I also don't see a way to parse out the text making up the date field in the rules dialog. I'd like to do something like this:
substring ( expiration_date, 7, 4) < substring ( today(), 7,4) AND
substring ( expiration_date, 1, 2) < substring ( today(), 1,2) AND
substring ( expiration_date, 4, 2) < substring ( today(), 4, 2)
Unfortunately, I don't see a way for InfoPath to allow the substring on the field (expiration_date). So, before I completely give up, does anyone have a solution?
Thanks,