setting up a rule for a date field of type text - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

setting up a rule for a date field of type text

Last post 09-09-2014 10:15 AM by cafescott. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-09-2014 10:15 AM

    setting up a rule for a date field of type text

    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,

     

     

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.