Submit Button versus Form Submit Rules - InfoPath Dev
in

InfoPath Dev

Submit Button versus Form Submit Rules

Last post 04-09-2015 08:00 AM by Doreen. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 08-21-2013 12:43 PM

    Submit Button versus Form Submit Rules

    (Hmm... let's try this again)

    OK , so we are on SPT2010 and INFOPATH2010.

    In InfoPath, I have created an intake form with 2 views. an "Intake" view and an "Evaluation" view.

    Each view has a seperate submit button (on purpose)

    Intake View has a submit button at the bottom with the following "submit button rules" attached to it with no overwrite of existing files:

    1. SUBMIT: Always execute with no conditions. Run this action: submit using a data connection to "IntakeFormLibrary"
    2. SwitchView: Always execute with no conditions. Run this action: Switch to view : "AnalystEvaluationView"
    3. CLOSE: Always execute with no conditions. Run this action: Close this form no prompt

    Evaluation View submit button has similar data on it's button rules but will overwrite the file:

    1. SUBMIT: Always execute with no conditions. Run this action: submit using a data connection to "IntakeFormLibrary"
    2. SwitchView: Always execute with no conditions. Run this action: Switch to view : "IntakeView"
    3. CLOSE: Always execute with no conditions. Run this action: Close this form no prompt


    Now I get stuck.

    The view does not switch when the forms are entered.

    Are these supposed to run in the Form Submit? I tried it...I created a Form Submit rule

    1. SubmitToA3: Runs without conditions and submits to a data connection to the secondary location where I want the data to go...

    What did I do wrong? What questions Do you have? Why is the sky blue? Why do you pay tolls on a Freeway? #GettingPunchyInNH

    Rocco Castellano
  • 08-21-2013 02:45 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Submit Button versus Form Submit Rules

    Order of the rules is important.  Maybe you should switch first, then submit and close? 

    Did you disable the submit functionality in the Tools > Submit Options? or whereever that is in 2010.

    Check your view properties.  What view is on View Settings tab or Print Settings tab (forgive me, but I am using IP 2007). Is view blank?

    Did you change the view name at some point and it didn't update in your rules?

    Did you by any change switch the view in the code behind?

  • 08-23-2013 05:12 AM In reply to

    Re: Submit Button versus Form Submit Rules

    thanks for the suggestion Doreen.  It's still not working but It makes sense to promote the "change view" to the first line.

    I have other issue with this that I need to "tackle" first, then I'll get back to this issue but it was a helpful suggestion.

    thanks.

    Rocco Castellano
  • 08-24-2013 05:54 PM In reply to

    Re: Submit Button versus Form Submit Rules

    Hi RoccoNH1,

    Switching to view before close won't cause the form to show that view on the next open (since that is a separate form instance).

    Just add a Status field and set that field instead. Then, add an Form Load rule (under the Data tab) that checks the value of that status field and switches to the view.

    Should be a piece of angel food cake... light and tasty!

    Patrick Halstead
    Project Manager at Qdabra
  • 09-13-2013 01:12 AM In reply to

    • Topper
    • Not Ranked
    • Joined on 09-13-2013
    • Posts 1

    Re: Submit Button versus Form Submit Rules

    I've got a question that it's being impossible to solve. I need a button or whatever to submit my infopath form, and after that, refresh my form without losing data and continue working. I need this, because I need the ID of the form that I gonna create, but when you are editing the form, the ID doesn't exist yet. To get the ID you need to submit, close form, and open again.. but this is not functional for the user.. I need automatically and without closing... The buttons of the infopath, only submit, or only refresh.. I dont see both at once.. and using rules.. there are not the option to refresh... Anyone have an idea how to do it? Thanks
  • 09-13-2013 04:57 AM In reply to

    Re: Submit Button versus Form Submit Rules

    Hi Topper... so let me make sure I understand this correctly... you need to have a unique ID on your InfoPath form... that seems like that is the inevitable goal here right?  I think where you are struggeling is the other part of this.....a SharePoint Designer workflows.

    I'm assuming you are n SharePOint 2010 or at elast 2007... and with IPTH the same.

    The way I have solved this issue in the past is through a combo of SharePoint, SPT Designer and Infopath working in unison.

    To give the form a Unique ID (lets call this new value the "NewID")....you have a custom list on SharePoint value the ID... and have a cell in the InfoPath form do a formula like (=MAX@NewID+1) This returns the highest value in the list called "NewID" and adds one. In the form your data connection is used to name the form that NewID from the Infopath form. In the background in a SharePoint Designer workflow, you pass the "NewID" through a variable to the list.  When you submit you send this new number to the NewID list through a variable in Designer.....giving you your NewID number before it is generated. (Yes I know it sounds simplistic in the description, but I have done it before and it does work) again...this is done through a workflow in SharePoint Designer. Now the only issue in this is volume. If you have 30 people all entering at the same time, it is possible for one to overwrite the other, so ID and another characteristic is what I used (Like last name) make the unique identifer for the form. (Topper_123.xsn)

    In the case of "refreshing the form without losing data", I would think the way to do that is to have multiple views. So lets just say you have an "IntakeView" and an "Analysis View". The goal being that you have an Intake is the default form and the Analsyt has to go in and validate info and populate new fields that the person doing the Intake does not need to see. You can pass that data to the other view. lets start there. did I understand your questions correctly?

    IDK, its early maybe I'm wrong... is there an easier way? Did I understand your need correctly?

    Rocco Castellano
  • 09-13-2013 03:16 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Submit Button versus Form Submit Rules

    Hi Topper,

    I guess I am becoming an advocate for this method to create a unique ID: http://www.infopathdev.com/forums/p/26341/91512.aspx#91512

    I call it the double-submit method and it is foolproof.  Basically you set value to a field called "key" and promote the field to the library.  Create a retreive data connection to the library.  In your submit rules, submit the form but don't close it. Now, the library ID has been assigned to your form, retreive the ID (see steps in link for details). You can now assign the ID to a field in your form and manipulate it to your heart's content.  Finally submit the form again and then close the form.  Follow the steps in link exactly for thorough explanation.


    Doreen

  • 04-08-2015 11:19 PM In reply to

    Re: Submit Button versus Form Submit Rules

    Hi, I have an Infopath form with Submit button using Rules and Custom Code. I have added rules to set a text box value and submit the data. After submitting the data , my form remains still open!! However the data is submitted to Form Library but i want after submission user should be taken back to form library. If I add a rule to close the form no prompt, I am getting a message "The form is closed". I want user to be redirected to Form Lib automatically after form submission. Please suggest how it can be done.. Thanks in advance....
    Filed under:
  • 04-09-2015 08:00 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Submit Button versus Form Submit Rules

    Remember that Rules run before Code.  I am not sure if the order of operations is your issue but here's a snippet of C# code that I have used (in InfoPath 2007) to close a form through code. Maybe it will help you:

    //CLOSE APP
                    try
                    {
                        //close form and app window.  this.close(); does not work here
                        this.Application.ActiveWindow.Close();
                    }
                    catch (NullReferenceException ex2)
                    {
                        MessageBox.Show("Error: " + ex2.Message + ", " + ex2.InnerException);
                    }
                    finally
                    {
                    }

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