Closing a form with rule - InfoPath Dev
in

InfoPath Dev

Closing a form with rule

Last post 08-18-2008 05:33 AM by Anuma. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-18-2008 01:36 AM

    • ErikvanD
    • Not Ranked
      Male
    • Joined on 07-02-2007
    • Netherlands
    • Posts 5

    Closing a form with rule

    Hi,

    I have Infopath 2007 form that on opening checks the users network login with a field from a SQL database. When equal the user can complete and submit the form. So far so good.

    When not equal the user gets a messagebox saying he has no permission. I have defined this as a rule on one of the form field. I would like the form to close automatically after the user has clicked on "ok" in this message box. I have searched a lot on this board and the internet but have not found a suitable solution yet.

    Anyone any idea?

    Thanks,

    Erik

  • 08-18-2008 05:33 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Closing a form with rule

    Hi,First add user roles as "User1" and "User2" and for "User1" you need to close the form. Use following code in the on load.                                                                            

     

     if(thisXDocument.Role != "User2")
    {
    alert("Add your message here");
    thisXDocument.View.Window.Close(true);
    }

    I hope this will help you.

    Anuma Chinthapalli /
    http://www.GGKTech.com
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.