Close an InfoPath Form - InfoPath Dev
in

InfoPath Dev

Close an InfoPath Form

Last post 05-22-2017 06:48 AM by veney. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-19-2017 06:41 AM

    • veney
    • Not Ranked
    • Joined on 09-11-2009
    • Posts 14

    Close an InfoPath Form

     Hello,

    Using InfoPath 2010, I am trying to close a form based on a condition.  I tried to create an action rule, based on a condition for example:  if field 1 is not equal to field2 then close/exit InfoPath.

    I was not able to find a “Close the form” InfoPath Action which does exist in InfoPath 2007.

    Can anyone suggest/provide a solution?


    Thanks in Advance,

    Rodman Veney

     

  • 05-19-2017 07:40 AM In reply to

    I'm wondering if your rules are on a field instead of a button? Buttons have the Close the form action - but fields do not....
    Hilary Stoupa

  • 05-19-2017 07:47 AM In reply to

    • veney
    • Not Ranked
    • Joined on 09-11-2009
    • Posts 14

     Hilary,

    Thank you for your response.  I now remember that  I was using a button in the 2007 version to close the form.   Is there a way I can close a form based on field conditions.  If there is a way via code can you provide a sample of th4 code that could be used?

    Thanks in Advance,

    Rodman 

  • 05-19-2017 08:03 AM In reply to

    I'm pretty sure this is a limitation of the InfoPath object model - kinda like how you can't use a rule to change a view based on a field change and also can't do that in code. I'm pretty sure you'll get an "Invalid context for OM call" error.
    Hilary Stoupa

  • 05-22-2017 06:48 AM In reply to

    • veney
    • Not Ranked
    • Joined on 09-11-2009
    • Posts 14

    Hi Hilary,

    Thank you for your advice and support. 

    Based on your information, I created a new view to close/exit the form via a button.  If the condition:  field1 != field2 then switch to the close form view (which displays a Close form button) enabling the user to close and exit the InfoPath form.

    Again, Thanks for Your Help/Support!

     - Rodman

     

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