Issues when people click on 'Cancel' on the email submit box - InfoPath Dev
in

InfoPath Dev

Issues when people click on 'Cancel' on the email submit box

Last post 01-23-2009 04:43 AM by swathip. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-21-2009 02:30 AM

    Issues when people click on 'Cancel' on the email submit box

    Hi All,

    I have a submit button on a form using the "submit" action but with custom rules.  I have one rule setup with 2 steps.  First step changes a "status" field and the second step submits via email.  When the status is changed i have set it up to show some hidden sections that i don't want the person who is submitting the form to see.   All works ok apart from if the submitter clicks on 'Cancel' on the email dialog then they return to the form with the status change and thus seeing the hidden section.  Is there a way round this? - ie if a user clicks on cancel then another rule fires changing the status back??  I have tried adding this rule after the submit and it dosen't fire.   

    Thanks all

    J

    (PS user roles aren't an option, and i am using Infopath2003)

  • 01-21-2009 02:55 AM In reply to

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

    Re: Issues when people click on 'Cancel' on the email submit box

    Hi,

    You need to change order of your Rules. First should be Email Submit and second one should be Status.

    In this way status will not be changed if you cancel the email also. And also your hidden sections will not be displayed.

    I hope this will help you.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 01-21-2009 03:29 AM In reply to

    Re: Issues when people click on 'Cancel' on the email submit box

    Thanks but that won't work how i need it to work.  I need the recipient of the form to be able to see those hidden fields.  In the method above the status will be the same on the attachement that is being sent, hence not being able to see those hidden fields.  

     

     

  • 01-23-2009 04:43 AM In reply to

    Re: Issues when people click on 'Cancel' on the email submit box

    Hi,

    You can do this using code.

    public bool SubmitToEmail(string emailAdapterName, string to, string cc, string subject, string intro)

    {

    try

    {

     thisXDocument.Errors.DeleteAll();

     EmailAdapter email = (EmailAdapter)thisXDocument.DataAdapters[emailAdapterName];

     email.To = to;

     email.CC =cc;

     email.Subject = subject;

     email.Intro = intro;

     email.Submit();

     return true;

     }

     catch (Exception ex)

     {

      string sMessage = FAILED_UNKNOWN;

      return false;

     }

     }

     

    In the button onlcick event write the following code.

    If(SubmitToEmail("emailAdapterName,"to value","cc value","subject", "introduction"))

    {

    thisXDocument.DOM.selectSingleNode(<status field xpath>).text = "status value";

    }

    Swathip
    www.ggktech.com
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.