none
submit button doesn't close the form

    Question

  • Hi every one

    I have a sharepoint list which was working fine up to now.

    Now the problem is that the submit button in the 'new' form submits data in the list but does not closes the form. Actually when user presses submit button, nothing happens to user. It remains in the form.

    I checked the button's submit options and 'after submit' action is set to 'close the form'. And there's not any rules

    Any hints are really appreciated.

    Sunday, December 01, 2013 2:33 PM

Answers

  • The form was functioning flawlessly and it doesn't. In this period of time one of my coworkers has done something ( I don't know exactly what, and I don't know if it was related to this form or not) and now the form doesn't work as before. I checked related settings  but I couldn't solve the problem. 

    I restarted IIS. It didn't help.

    Thank you for your in detail answers.

     

    in this case, you really have to check with your co-worker and figure out what modifications he did (if any) in order to reverse it, this would really ease things out.

    if for some reason you can't verify with you co-worker, then please double check the below:

    • if any rules were created on the submit button
    • verify if the data connection used to submit the form

    further more, you can try the below where you rebuild the submit elements;

    first of all backup your form: simply, open the form in InfoPath, save a copy to another location, then save again to the original template location (you must save again in order to have the new modification saved to the template and not the backup).

    • Delete and recreate the submit data connection, create a new data connection with the following: in data connection wizard> choose Submit data> click on to a document library on sharepoint site> type in library path and naming syntax> finish
    • Delete and recreate the submit button: >Home tab from ribbon> drop down the controls section and choose button> when button is inserted, right click on it > properties > in general tab button action, make sure its set to rules and custom code> label you button and click ok.
    • create a rule on the button: >click on the button > in home tab from ribbon click Manage Rules> New> Action> leave the condition intact (by default its "Rule runs when button is clicked")> in Run these actions click Add> choose submit data> choose the data connection you just created> ok > in Run these actions click Add one more time> choose Close the form> ok.
    • save your form, then publish it: File> Publish> Publish to Sharepoint server. DON'T Quick Publish as this feautre is known to have issues, sometimes using quick publish breaks some data connections (i personally never use it), make sure you choose Update form in the publishing wizard as it sometimes selects create new form automatically).

    this should do it for you, let me know how it goes.


    Aabed - If a reply helps you Vote As Helpful, if a reply solves your problem don't forget to Mark As Answer.

    Wednesday, December 04, 2013 10:43 AM

All replies

  • I would say check form rules and make sure they are not conflicting with each other.

    Also check if you are running in to following situation.

    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c60939ae-0a94-47ee-a411-21b89592d7b5/how-to-close-infopath-form-after-submission-when-two-buttons-exist?forum=sharepointcustomizationprevious

    Did you check ULS Logs and see if there were any errors related to InfoPath Services?

    If nothing helps then please elaborate the situation and provide more details on your rules and I will try to replicate this at my end.


    Amit


    Sunday, December 01, 2013 2:50 PM
  • Thank you for your response.

    There's no rules in my form. I just sends data for a single sharepoint list.

    But I found a InfoPath related log :

    "an event log to be applied against a form was invalid..."

    Which is related to my list and my site.

    What does this log mean?

    Monday, December 02, 2013 7:49 AM
  • check submit options,

    File> Info> Submit Options>

    expand the option by clicking advanced, and make sure that After submit: Close form is selected.

    if thats not the case,

    try removing the Submit button, then create it again with after submit set to close form and republish your form.

    let us know how it goes


    Aabed - If a reply helps you Vote As Helpful, if a reply solves your problem don't forget to Mark As Answer.

    Monday, December 02, 2013 8:48 AM
  • please provide more details on the event log if possible.

    thank you


    Aabed - If a reply helps you Vote As Helpful, if a reply solves your problem don't forget to Mark As Answer.

    Monday, December 02, 2013 8:52 AM
  • I checked after submit options. It was set to close the form

    I removed and re-added the button but it didn't solve the problem.

    And unfortunately that error message does not appear always. I tried the scenario several times. The form is never closed. And I don't have that error message any more.

    Monday, December 02, 2013 12:47 PM
  • when modifying your form (in infopath),

    home tab from the ribbon> Preview>

    now try to submit your form through the button, does it close the preview after submit?

    what's the web browser you're working on?


    Aabed - If a reply helps you Vote As Helpful, if a reply solves your problem don't forget to Mark As Answer.

    Monday, December 02, 2013 1:02 PM
  • I checked the preview and

    Yes, The form is closed in the preview.

    I use IE9

    Monday, December 02, 2013 1:17 PM
  • i have to say, this is odd! we're seeing this issue more often, forms suddenly breaking.

    anyway, your form was functioning flawlessly, all the sudden form wont close after submit, while data is being submitted successfuly. right?

    if so, please try to perform an iisreset on your front-end/s (open CMD, type iisreset> hit enter) and check the form back again.


    Aabed - If a reply helps you Vote As Helpful, if a reply solves your problem don't forget to Mark As Answer.


    • Edited by AaYassine Monday, December 02, 2013 2:34 PM typo
    Monday, December 02, 2013 2:11 PM
  • The form was functioning flawlessly and it doesn't. In this period of time one of my coworkers has done something ( I don't know exactly what, and I don't know if it was related to this form or not) and now the form doesn't work as before. I checked related settings  but I couldn't solve the problem. 

    I restarted IIS. It didn't help.

    Thank you for your in detail answers.

     
    • Proposed as answer by AaYassine Tuesday, December 03, 2013 8:51 PM
    • Unproposed as answer by AaYassine Wednesday, December 04, 2013 9:54 AM
    Tuesday, December 03, 2013 4:22 AM
  • Hello,

    >and now the form doesn't work as before.

    Do you meant that your form is not working either? if so then what error you are getting.

    >an event log to be applied against a form was invalid

    This error very rare and come when there is any conflict between old and new form schema. So have ever modified your form? if yes then check all the rules and controls are in place.

    Finally to close infopath form, just try with this code if rule does not works:

    http://www.bizsupportonline.net/blog/2009/01/how-to-programmatically-run-code-close-infopath-web-form/


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Tuesday, December 03, 2013 8:53 AM
  • Hi Mohsenov,

    What is the Action set for your Submit button?

    If the Action is "Submit", Aayassine's solution above should work.

    If the Action is "Rules", you should create a new Action Rule and add two actions: Your submit connection and the Close form action.

    Regards,
    Jeremy


    Jeremy Ramos | .NET / SharePoint / Dynamics Developer

    Tuesday, December 03, 2013 10:32 AM
  • The form was functioning flawlessly and it doesn't. In this period of time one of my coworkers has done something ( I don't know exactly what, and I don't know if it was related to this form or not) and now the form doesn't work as before. I checked related settings  but I couldn't solve the problem. 

    I restarted IIS. It didn't help.

    Thank you for your in detail answers.

     

    in this case, you really have to check with your co-worker and figure out what modifications he did (if any) in order to reverse it, this would really ease things out.

    if for some reason you can't verify with you co-worker, then please double check the below:

    • if any rules were created on the submit button
    • verify if the data connection used to submit the form

    further more, you can try the below where you rebuild the submit elements;

    first of all backup your form: simply, open the form in InfoPath, save a copy to another location, then save again to the original template location (you must save again in order to have the new modification saved to the template and not the backup).

    • Delete and recreate the submit data connection, create a new data connection with the following: in data connection wizard> choose Submit data> click on to a document library on sharepoint site> type in library path and naming syntax> finish
    • Delete and recreate the submit button: >Home tab from ribbon> drop down the controls section and choose button> when button is inserted, right click on it > properties > in general tab button action, make sure its set to rules and custom code> label you button and click ok.
    • create a rule on the button: >click on the button > in home tab from ribbon click Manage Rules> New> Action> leave the condition intact (by default its "Rule runs when button is clicked")> in Run these actions click Add> choose submit data> choose the data connection you just created> ok > in Run these actions click Add one more time> choose Close the form> ok.
    • save your form, then publish it: File> Publish> Publish to Sharepoint server. DON'T Quick Publish as this feautre is known to have issues, sometimes using quick publish breaks some data connections (i personally never use it), make sure you choose Update form in the publishing wizard as it sometimes selects create new form automatically).

    this should do it for you, let me know how it goes.


    Aabed - If a reply helps you Vote As Helpful, if a reply solves your problem don't forget to Mark As Answer.

    Wednesday, December 04, 2013 10:43 AM
  • Hello and Thank you for your response.

    Unfortunately I can't test your solution now, But I guess this should solve it at last.

    I will try it later

    Regards

    Mohsen Fakhari

    Saturday, December 07, 2013 4:24 AM