how to detect if a field has been changed - InfoPath Dev
in

InfoPath Dev

how to detect if a field has been changed

Last post 07-09-2010 02:38 PM by Flanker. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-09-2010 11:52 AM

    how to detect if a field has been changed

    hi,

    I have a saved infopath form and wish to detect when a field has been changed.  The field is a date picker in a repeating table.  When the user enters a value, the date should display normally.  When the form is closed and then repoened, the date should display highlighted in yellow.  When the user changes/updates the date it should then display back normally.   

    There seems no option when using the conditional formatting that allows you to detect when a field has been modified.  Any help would be greatly appreciated. 

     

  • 07-09-2010 01:36 PM In reply to

    Re: how to detect if a field has been changed

    The behavior you describe doesn't exactly seem like you want to highlight if changed -- but that you want to highlight all the dates that are populated when the form is opened. Is that the case? You'll end up needing to add some kind of helper field for this -- maybe an attribute to the date field? You could call it "highlight" and make it a boolean, with a default value of FALSE. Then, on open, add a rule to set highlight = TRUE. You may have to manually modify the manifest (or use qRules, way easier) to set the highlight field to true only for items that have a date value. Add a rule to the date field to set highlight to FALSE when the date changes....

    If, instead, you simply want to know if the new date is equal to the previous value, it actually may get a little trickier. It is easier in code, because we can get the old value and the new value, but since we can't set control attributes (like background color, etc) in code, you'd still need some kind of helper field to set and to base your formatting off of.

    Hilary Stoupa

  • 07-09-2010 02:38 PM In reply to

    Re: how to detect if a field has been changed

    Hi Hilary,

    "The behavior you describe doesn't exactly seem like you want to highlight if changed -- but that you want to highlight all the dates that are populated when the form is opened. Is that the case?"

    Yes, exactly, that is the case.  The date I am referencing is a return to work date for a specific employee.  The idea is that if the user sets that date, he wishes to see the date highlighted the next time the form is opened.  And then if the user updates the date (even with the same date) the highlight should disappear.      

    "You'll end up needing to add some kind of helper field for this -- maybe an attribute to the date field? You could call it "highlight" and make it a boolean, with a default value of FALSE. Then, on open, add a rule to set highlight = TRUE. You may have to manually modify the manifest (or use qRules, way easier) to set the highlight field to true only for items that have a date value. Add a rule to the date field to set highlight to FALSE when the date changes...."

    The problem I see with a helper field, is that this date field is in a repeating table and there could be possibly 100's of dates set. Also when the form is opened, the user could add another entry in the repeating table and set the date.  I'm am not familar with qRules so I will have to investigate. 

    Thanks again for your input... much appreciated

     

     

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