Using formstate to store values - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Using formstate to store values

Last post 12-15-2009 06:36 AM by mrsafe. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-07-2009 10:44 AM

    Using formstate to store values

    Hi There,

    I wondered if anyone could clarify my understanding of formstate in browser based forms.

    As I understand it, I can use formstate to get and set properties that will persist accross server sessions.

    Does this mean I should be be able to set a formstate value in the submit event handler and when I reopen the same form the formstate value should be whatever I set it to before the form was submitted?

    The reason why I'm asking is that I use a method that allows a sngle submit button to be used by both admin and users of the forms. When the form is reopened by an admin for example, the admin changes say a status field dropdown and clicks submit. The form will then overwrite the original if it existed. My problem is the email that is only supposed to fire once, fires every time.

    This is of course expected behaivour if your send emails method is fired from inside the the submit event handler.

    So I need a flag of some description which lead me to the formstate property. I thought if I set that to whatever just after the sendemails method; that value would be stored so when the admin opens the forms and submits again, the value could be read and emails omitted if the value previously set, matched. Some how I think that's not the case.

    Any suggestions or guidance?



  • 12-15-2009 06:28 AM In reply to

    Re: Using formstate to store values

    You are barking up the wrong tree. Why not have two buttons that conditionally show based on who opens the form? Then, you can set a value in the form and save it and next time opened you can use conditional formatting and/or On Load rules to change what displays.

    Patrick Halstead
    Project Manager at Qdabra
  • 12-15-2009 06:36 AM In reply to

    Re: Using formstate to store values


    Hi Patrick Thanks for the reply, I have since used form fields to accomplish my goal, however, I still would appreciate an explaination of what the formstate actually does?

    Thanks again.

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