disabling submit feature for re-opened xml forms - InfoPath Dev
in

InfoPath Dev

disabling submit feature for re-opened xml forms

Last post 05-19-2016 01:50 PM by tmAmin. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 09-22-2009 01:07 PM

    disabling submit feature for re-opened xml forms

    There are probably hundreds of posts and solutions in forums everywhere answering this. But my situation is a bit different.

     We have an IP form submitting to a SharePoint library. Currently, employees can view the submitted xml files inside the library, and even make changes to the files and save it. The problem is that there is a submit button at the bottom that is confusing users. I want to disable it--but only when a form is successfully submitted, and only if the xml file generated by the submitted form is re-opened. (Basically, I don't want users accidentally submitting the same form again when changes are made to the data--we have that being tracked with version history).

     Unfortunately, my attempts were unsuccessful. Every time I re-open a previously submitted form, the button is back, no matter how many times I tell it to go away using conditional formatting, hidden fields, rule etc.  I'm perfectly aware that I can utilize the Me.[New] Property with managed code, but I was hoping for an IP solution.

     Is there a way to tap into the xmlform.new property through rules or conditional formatting? Or is there a solution I missed?
  • 09-23-2009 12:44 AM In reply to

    Re: disabling submit feature for re-opened xml forms

    i would suggest the best option would be to use your custom submit buttom and use conditional formatting on that. say when you submit the form first time, set the value of a field(say submit_check) to some value (say true).

    and on the button use conditional formatting

    (submit_check is equal to true)

    hide the button

    that should work for you

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 09-23-2009 05:53 AM In reply to

    Re: disabling submit feature for re-opened xml forms

     

    Qazi Anis:

    i would suggest the best option would be to use your custom submit buttom and use conditional formatting on that. say when you submit the form first time, set the value of a field(say submit_check) to some value (say true).

    and on the button use conditional formatting

    (submit_check is equal to true)

    hide the button

    that should work for you

    How do you diferentiate between the first time the form is opened, and the second time it's opened, for viewing or editing? I ask because I did exactly what you mentioned:

    I had a hidden field in my datasource, "disableBtns" (with a default value of false) that when the user filling out the form clicked the submit button, a rule fired settting disableBtns to "true". Then I had conditional formatting on my custom submit button that said that if disableBtns was equal to true, then hide and disable the button.

     It worked--the first time. The second (third, fourth etc.) time the form was re-opened from the Share Point library where it was submitted, the button was back.

  • 09-23-2009 06:22 AM In reply to

    Re: disabling submit feature for re-opened xml forms

    well it seems u r doing the right thing, but somewhere the value of "disableBtns" gets reset somewhere. check the logic inspector to see where the value of "disableBtns" gets reset. That should help you.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 09-23-2009 07:15 AM In reply to

    Re: disabling submit feature for re-opened xml forms

    Qazi Anis:

    well it seems u r doing the right thing, but somewhere the value of "disableBtns" gets reset somewhere. check the logic inspector to see where the value of "disableBtns" gets reset. That should help you.

     

     

    I couldn't find a logically error, however, I did get it to work using another method. 

  • 09-23-2009 07:49 AM In reply to

    Re: disabling submit feature for re-opened xml forms

    would you like to share your solution

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 11-16-2009 11:51 AM In reply to

    Re: disabling submit feature for re-opened xml forms

    (re-posted from a blog post on our private intranet...)

    "Single Submit:disabling submit functionality in InfoPath"

    Forms developed in InfoPath for browser-SharePoint library interaction generally have a submit button to send the xml file to the library. Occasionally, this submit button needs to be disabled; maybe until fields are filled out, or so users don't accidentally hit it more than once after it's been submitted. Usually, a clever bit with a hidden field in the data source, a rule, and some conditional formatting will solve this error. For those not familiar, the set up is:

    1. Have a hidden field (i.e., in the datasource but not on the form user interface) set to a default value of show, enabled, 1, etc.
    2. A rule that stipulates once the submit button is pressed, change the value of the hidden field to the opposite value; hide, disabled, 0, etc.
    3. Conditional formatting on the button that says when the hidden field is equal to disable etc., either hide or disable the button.
    4. (this can also be done programmatically, which prefer, now that I'm an incipient programmer)

    And this is likely fine if end users have no need to reopen the xml form once it's been submitted to a SharePoint library. Because once you open the form, the value in that hidden field is reset to the default. I'm not sure what causes this, but it was the source of my agony for my latest form, because very occasionally, an InfoPath form's functionality calls for the ability to not only submit a form, but to disable the submit as well.

    The last form I created needed to submit the first time, but not the second, third, or other times opened. And an added hitch: it had to be a solution through the InfoPath designer user interface, not managed code. (…Because forms with managed code need to have full trust, which needed to be uploaded through central admin, which don't play nice (read: don't work at all) with the versioning history capability that was also necessary on this form)

    Here is my solution:

    1. A submit connection to my SharePoint library.
    2. Unique file names that do not overwrite built into said submit connection. (I used an xpath formula builder to concat a few of fields in the form)
    3. A secondary data connection to receive data from the library where the forms are submitted. (Specifically, retrieving the unique file name)
    4. On the form, I have an expression box set to the value of the unique file name (through secondary data connection)
    5. Conditional formatting on my button that stipulates when the unique file name field in my secondary data source is equal to the xpath in 2), to hide/disable the button.

    Viola! A form that has a submit button at the bottom during the first instance of opening, but disappears the subsequent instances.

    (It's also worth noting that this technique only works on the current form. If I hadn't needed the versioning capability, I might never have discovered I had to change a setting inside my receive connection [to get the unique file name]. I unchecked the "Include data for the active form only" on the third screen of the data connection wizard, and then it worked beautifully.

    Happy Developing!

  • 05-17-2010 11:43 AM In reply to

    Re: disabling submit feature for re-opened xml forms

    I can't figure out how to get the unique file name? Can you give me a push?

  • 07-21-2010 08:30 AM In reply to

    Re: disabling submit feature for re-opened xml forms

    Sorry for taking forever to get back to you. I'm not sure what you mean exactly, so I'll just detail the whole process.

    • Behind the scenes, there is a hidden field in my data source that stores the unique file name (see next) upon submit. This drives the process. New forms don't have a value for this field, but ones that have been previously submitted, will have it.
    • When creating the secondary dc (data connection) for Submitting to the SharePoint library, I specified a unique file name (as a concat of the username and the time submitted) and stored it in a column in the SP Library.Upon submission, the value is also captured in the hidden field (see previous).
    • Another secondary dc grabs the title from the SharePoint repository and stores it in an an expression box that is hidden from user view.
    • The submit button is set to be disabled via conditional formatting when the the expression box value (i.e., the title from the SP list ) is equal to the value of the hidden field.
    Hope that helps!

     

  • 05-19-2016 01:50 PM In reply to

    • tmAmin
    • Not Ranked
    • Joined on 05-19-2016
    • Posts 1

    Re: disabling submit feature for re-opened xml forms

    I have made an InfoPath form where I have custom Submit button. I used the custom Submit button to run few rules such as submit data to a list and send email to the user. Now both the built-in Save button and custom Submit button are acting in a same way, i,e the rules are running whether I am saving the form or submitting the form. This is creating problem for me as later when someone edit an item in the list and save it, users are getting email which suppose to only occur when someone submit the form, not edit.

    Can you pleasehelp me how I can resolve this problem. Thanks.

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