Sending a non-active view via email? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Sending a non-active view via email?

Last post 06-06-2016 08:06 AM by iLoveData. 22 replies.
Page 1 of 2 (23 items) 1 2 Next >
Sort Posts: Previous Next
  • 05-10-2012 11:36 AM

    Sending a non-active view via email?

    InfoPath 2010:

    Currently, I can send only the active view via email; I want to send a different view.

    I Create a command button --> add a rule --> Submit Data --> As an e-mail message --> fill in some email addresses --> and the only options next are sending the active view or sending form data as an attachment.

    I want to send a different print view without a bunch of help text and such that is on the current view. 

     Any pointers?

    ~Dustin.

    Filed under:
  • 05-11-2012 05:25 AM In reply to

    Re: Sending a non-active view via email?

    So I tried tricking InfoPath into thinking the active view was a different view.  I setup my button with the following rules:

    1. Switch to View: Invite - Printable
    2. Submit using data connection: Email submit
    3. Switch to View: Invite

    I didn't quite work:

    1. It switched views
    2. sent me a completely blank email.
    3. errored on switching view back saying: "A rule tried to switch to a view while the view was already being switched."

    hmm....  On there onload events for views?  When I switch the views, the new view could have an onload event the emails me the current view and switches back to the original view...

    Filed under:
  • 05-11-2012 05:27 AM In reply to

    Re: Sending a non-active view via email?

    How hard would it be to setup a custom email button?  Maybe I should try that...

     ~Dustin.

    Filed under:
  • 05-11-2012 07:02 AM In reply to

    Re: Sending a non-active view via email?

    InfoPath is mean like this.

    What we do is have two sections in the active view (the one that we can email). We add a true / false (boolean) field named something like "isEmailing" and default it to false.

    Then, in conditional formatting, hide one section if isEmailing is false, the other section if isEmailing is true. All the controls that the user fills out or should see while filling out the form go in the section that hides when isEmailing is true. All the stuff we want in the email goes in the section that hides when isEmailing is false.

    Then, the rules on the email button would be:

    1. Set isEmailing to true (hides the fill in section, displays the email section)
    2. Submit via email
    3. Set isEmailing to false (hides the email section, displays the fill in section)

    Hope that makes sense....

    Hilary Stoupa

  • 05-11-2012 10:06 AM In reply to

    Re: Sending a non-active view via email?

    Hilary!  Your solution rocks!

    Just upgraded to InfoPath 2010, so it took me a bit to find were they put conditional formatting, but this is awesome.

    Thanks!

  • 05-11-2012 10:09 AM In reply to

    Re: Sending a non-active view via email?

    I am unwilling to publically confess how long it took me to find conditional formatting in IP 2010. I actually thought for a while I had found a bug - that they had forgotten it. :-)

    Hilary Stoupa

  • 10-26-2012 02:05 PM In reply to

    Re: Sending a non-active view via email?

    Hi Hilary,

    I'm new to using InfoPath and I've inherited a template from someone who left my company. The form is pretty complex. Since I've gotten it I've only had to make a few very basic updates. Shortly after I published the updated template to our SharePoint site people began reporting the same error "tried to switch view while view was already being switched." I have my submit button set up like Dustin's above with a switch view action, followed by several submit using data connection actions and a final switch view action. The only change I've made to this button is to insert a new 'submit using data connection' action right in the middle. 

     Now, not only am I getting the 'tried to switch view...' error message but the new data connection submit action isn't working.

     I can't figure out how my predecessor got having two switch view actions to work. Also can't figure out why the new submit using data connection isn't working... let me know if you need more information, I can provide details if needed!

     Thanks,

    Megan

     

  • 10-26-2012 02:26 PM In reply to

    Re: Sending a non-active view via email?

    Hi - why is your form switching views multiple times on a single button action? What are the rules on the button?
    Hilary Stoupa

  • 10-26-2012 03:20 PM In reply to

    Re: Sending a non-active view via email?

    Here is one of the 4 rules in my submit button. All are set up similarly, the only difference being the data connections submitted to, based on what is contained in the form. Function: Set a field's value: field Submit_Date = today()Function: Set a field's value: field Submit_Status = "Submitted"Submit using data connection: SharePoint Library SubmitSwitch to view: ApprovedSubmit using data connection: HRG NotificationSubmit using data connection: CESSubmit using data connection: Email confirm to submitterSwitch to view: Submitted The form switches views the first time so that it cleanly displays in the emails that are subsequently sent out using the data connections (that is my assumption – I did not set this part up, it’s part of what I inherited). The form switches views the second time to ‘submitted’ so that the submitter gets an instant confirmation that the form was successfully completed & sent away. I also inherited this – but I’ve heard that before it was in place the test group would submit the same form numerous times because they weren’t sure it was sent to anyone but themselves. The underlined data connection is the new one. It is based on a contact selector set up like this:Group: HRG            Repeating Group: Person                        Field: DisplayName                        Field: AccountID                        Field: AccountType It is linked to a secondary data source Context:            siteUrl            provideAllFields            isStartWorkflow            isRunAtServer I think the last 3 are supposed to be Boolean but when I click the ‘show details’ checkbox they all show ‘string’. Perhaps that’s why the HRGs aren’t receiving a copy of the form via email?

    Thanks,

    Megan

  • 10-26-2012 03:26 PM In reply to

    Re: Sending a non-active view via email?

    So, if you read the beginning of this thread - if you switch views in a form and try to email it in the same ruleset (i.e., all in the same button click) your end user will get a blank email. I've laid out an alternate suggestion above.

    I've never had a form that switched views in the same action as sending an email not send a blank email - so I'm super surpised this was ever working for you prior to making your rule change....

    Hilary Stoupa

  • 11-01-2012 11:04 AM In reply to

    Re: Sending a non-active view via email?

    Thank you Hilary,

    I'm going to try your solution. Could you provide a bit more detail on adding the boolean field "isEmailing"? Is it a field I can insert using the 'Insert Controls' menu or is there some other way I should do it? I don't want it to be visible on the form.

     Thanks again for your help!

    -Megan

     

  • 11-01-2012 11:10 AM In reply to

    Re: Sending a non-active view via email?

    You can just add it on the data source task pane - if IP 2010, under the Data tab on the ribbon, make sure "Show Fields" is selected - your data source will display in a task pane on the right. Right click the group where you want to add the field and select "Add" - then you can type in a name for the field and select a data type (use True/False here).
    Hilary Stoupa

  • 11-01-2012 12:01 PM In reply to

    Re: Sending a non-active view via email?

    Ok, got that done. Leads me to another question - In order for this solution to work both sections (the data entry section and the email section) need to be two separate sections, correct? Is there a way I can copy all the sections I currently have that I want to put into a larger section that will be my 'data entry' section and keep the formatting? I can't seem to get it to work.

  • 04-11-2013 12:51 PM In reply to

    Re: Sending a non-active view via email?

    Hi Hillary,

    I'm skiddish about adding a section to my template to be used as an Email view.  Wouldn't this cause problems in the schema for forms published using an older template?

  • 04-12-2013 07:11 AM In reply to

    Re: Sending a non-active view via email?

     No - your section can be bound to an existing field - you won't have to add any new fields for this.

    Hilary Stoupa

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