How do I access the Form's Dirty flag for conditional formatting, ideally without using code? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How do I access the Form's Dirty flag for conditional formatting, ideally without using code?

Last post 08-26-2009 01:40 PM by Alec Pojidaev. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 04-24-2008 10:54 AM

    How do I access the Form's Dirty flag for conditional formatting, ideally without using code?

    I have looked around the forum and nobody has quite answered my question.

    I have a form which I am submitting to SharePoint.  I get the 'do you want to save Formx' message if the user tries to exit the form with outstanding changes - this is confusing for them as they don't understand the difference between saving and submitting, So I want to switch off the prompting on closing the form.  BUT I do want to warn users that IF they have made changes they could be lost. 

    My simplest solution is to have 3 buttons - Submit, Exit Without Submitting, Exit.  I would make the buttons different colours so they stood out.
    Exit Without Submitting should only be visible if there have been changes to the form
    Exit should only be visible if there have not been any changes to the form since the last submit

    How do I access the Form's Dirty flag from a conditional format ?  Or can I have a field which picks up the Dirty flag as a default value and then using conditional formatting based on that field?  I had thought of using a rule/after change to set a field's value to dirty if changes had been made but this would mean a lot of rules/code snippets from each of the fields and if the form already has a flag I could use it would be simpler.

    Thank you

    Catharine

  • 04-24-2008 05:04 PM In reply to

    Re: How do I access the Form's Dirty flag for conditional formatting, ideally without using code?

    You can use the following article to help you along the way: http://www.infopathdev.com/blogs/greg/archive/2004/09/15/Use-Code-to-Determine-a-Rule-Condition.aspx

    Since you will be using conditional formatting, you can skip the extra requirements needed to make this work with rule conditions.

    Hope this helps!

  • 04-25-2008 06:57 AM In reply to

    Re: How do I access the Form's Dirty flag for conditional formatting, ideally without using code?

    Thank you for your help.  I now have my conditional formatting based on a value in from code.  A couple of questions for clarity please.

    As I was using conditional formatting I did not need to edit the manifest - but if I did would this be the correct command for  Infopath 2007? or should I change the 2003 to 2007 ?

    xmlns:xdExtension=http://schemas.microsoft.com/office/infopath/2003/xslt/extension

    When a form is submitted, should the dirty flag be reset to false?  automatically ? (At the moment it does not seem to be the case in my form) Or is it something I should be re-setting manually ? or is there another flag to indicate whether something has not been submitted ? 

    I am trying to have an EXIT button appear if everything has been submitted - but EXIT Without submit button if there are updates to abandon.

    Thank you

    Catharine

  • 04-25-2008 07:48 AM In reply to

    Re: How do I access the Form's Dirty flag for conditional formatting, ideally without using code?

    Hi again

    I have tried adding the above line of code into the manifest and once saved and trying to re-open I get an error message - it is not a valid document -

    I am just pasting the above line before the > in the xsf:xDocumentClass 

    Any ideas

    Catharine

  • 04-25-2008 09:01 AM In reply to

    • Albert
    • Top 500 Contributor
    • Joined on 04-03-2008
    • The Netherlands
    • Posts 32

    Re: How do I access the Form's Dirty flag for conditional formatting, ideally without using code?

    Hello,

    Good news if you use InfoPath 2007, this namespace is allready declared in a new InfoPath 2007 template, so you can skip that.

    If you use(d) InfoPath 2003 to create the template you probably made mistake adding the namespace declaration to the manifest.xsf file.

    An example:

    Goodluck

     

  • 04-28-2008 02:44 PM In reply to

    Re: How do I access the Form's Dirty flag for conditional formatting, ideally without using code?

    Thanks Albert for jumping in with some answers!

  • 08-25-2009 12:46 PM In reply to

    Re: How do I access the Form's Dirty flag for conditional formatting, ideally without using code?

    What if the user just decides to close the form (file->Exit) or by clicking the X in the upper right hand corner? Will they get a warning that they haven't submitted the form?

  • 08-26-2009 01:40 PM In reply to

    Re: How do I access the Form's Dirty flag for conditional formatting, ideally without using code?

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