Include data for the active form only fails in receive data connection of Infopath Form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Include data for the active form only fails in receive data connection of Infopath Form

Last post 01-24-2013 10:07 PM by Alandha. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-20-2013 10:47 PM

    Include data for the active form only fails in receive data connection of Infopath Form

    Hi Team,

    Our client requirement is that once a form developed using Infopath 2007 has been submitted and when any user tries to view the submitted form, the Submit button should get disabled not allowing the user to submit it once again. For implementing this, i have done the following:

    1. Created a column called "Submitted" of data type Single line of text in form library to which the Infopath Form is associated and kept the default value as 0.

    2. Created an action in Nintex Workflow to set the Submitted column value as 1.

    2. I have  created a new Receive Data connection in Infopath form and selected the source as SharePoint List or Library.

    3. In next step, i have provided the url of the Form library where the form should get submit in order to receive the value of Submitted column from the library. While in the process, where it is asking us for selecting a field  Imp: I have checked the checkbox "Include data for the active form only" (PFA).

    4. In the Conditional Formatiing of Submit button, i picked the Submitted column from Data Connection and kept the condition as below:

    If Submitted equals 1(select a text), Disable this control.

    The above functionality worked as required when the form is deployed to SharePoint 2007. But recently, we migrated the SharePoint  to 2010 and this functionality failed for Infopath while deploying it.

    Has anyone came across this issue before? Can anyone provide us the reason behind the failure and provide me a solution to handle such issue?

    Thanks!

     

    Regards
    Alandha
  • 01-21-2013 05:18 AM In reply to

    Re: Include data for the active form only fails in receive data connection of Infopath Form

    That's an interesting solution. Why the need for a Workflow to achieve this?

    It can be done within the InfoPath form itself, right? Simply have a field in the form called "DisableSubmit", boolean, False by default. When a new form is opened, this means Submit will be enabled. Then, when the user submits, have a rule (in the submit button itself) that flips DisableSubmit to true. That means that the next time the xml form is opened, DisableSubmit=TRUE and thus the Submit button is disabled.

    If you need to have a dependancy on a specific Status, then that can be done within the form too, simply have a field called Status. When the form first gets opened, set Status = NEW. When the submit button gets clicked, the Status gets set to Submitted.

    As far as fixing the issue you currently are faced with, I would review the Nintex workflow and the form in design mode to make sure that nothing broke after the migration to SharePoint 2010.

    Hope this helps.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 01-24-2013 10:07 PM In reply to

    Re: Include data for the active form only fails in receive data connection of Infopath Form

    Thanks Ernesto for the suggestion.

    I have implemented as mentioned by you and this worked fine when i filled all the form fields and submitted the Form. Once submittion is complete, i navigated to Form library where the form gets submitted and opened the item and found that the Submit button is disabled.

    But, if i leave the mandatory fields empty and click on Submit button, a validation error message would trigger and once i close the validation message and come back to form, i found that the Submit button is disabled. And i understood why it came because the rules were set in in Submit button control and upon clicking it the rules will any way execute.

     So what i did is I set rule when the form loads to set the DisableSubmit field to TRUE. For settings this, follow the below steps:

    Go to Tools--> Form Options --> Select Open and Save --> Under Open Behaviour, select Rules.

    Under rules, Created an action for setting the DisableSubmit button equals TRUE when any of the mandatory fields in the form are not blank. As we know that when the form loads for the first time, this condition doesnot satisfy and thus DisableSubmit as set by default will be TRUE. Once we submit form, all the mandatory fields will anyhow have values and in second loading of the submitted form will satisfy the condition and then the DisableSubmit will be set as TRUE.

    That is, Assume Location is a dropdown field in my form which is mandatory then

    If Location != blank,  Set DisableSubmit=TRUE

    Here by my issue was fixed.

     

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