Save without all required fields filled - InfoPath Dev
in

InfoPath Dev

Save without all required fields filled

Last post 05-17-2015 08:05 PM by royabc. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 03-11-2011 07:33 AM

    Save without all required fields filled

    I have spent a lot of time searching the net for an answer. I have found some but, they just wont work. What I have is forms that have required fields on them that we use as validation rules to make them required. I want the user to be able to save the form and not submit until they have all the required fields filled. The submit runs to a data connection and the save runs to a data connection. Were using sharepoint. So, the submit starts the approval process, but the save sends the form to the sharepoint site that every user has access to their individual site. The idea is that they are then able to go back and open the link (form) and continue where they left off. Is there a way to save the form at anytime?

    I need to have validations on each field that is required becuase we have checkboxes and radiobuttons that link to each other at times. And the submit button is disabled untill all required fields are filled. So, they cannot submit. They can only save, but the only way to save is if all req. fields are filled. Anyone have some ideas or a way to get around this, that would be awsome. Thank you in advance.

  • 03-11-2011 08:05 AM In reply to

    Re: Save without all required fields filled

    The way I use to do this takes work on your part, but will accomplish the goal.

    I create one new field, Savable.  I use a boolean. This field does not have to be visible within your form.

    In each field that has a validation, I add to the validation -> and Savable is not equal to true. (if Savable is True, validation wont require anything)

    In the Save button, add a rule before your submit rule, Set Savable to True.  The rule should set the field Savable to true.  This will turn off all of the validation and allow users to save the form.

    In the rules for opening the form, add a rule, Set Savable to false. The rule should set the field Savable to False.  This will turn on the validation every time you open the form.

    The longest part will be adding the extra validation rule.

  • 03-11-2011 08:30 AM In reply to

    Re: Save without all required fields filled

    We have to do exactly the same thing in a lot of our larger, more intense forms. We allow the user to "Save as Draft" as many times as necessary until they are happy with the form and want to submit it for approval. The key is to remove all the validation errors and then save the form. At this point you also want to disable the "Submit" function so they cannot submit the form with errors. This allows them to continue working on the form and they can come back to it anytime. In our save routine, we check to see if they are saving as a draft or submitting. If they are saving as a draft, we use the Errors.DeleteAll() before we save the form. Here is a snippet of the logic:

    If SaveAsDraft Then

    ' Set this value so that we can save the form without requiring all entries to be selected.

    xnInDraftMode.SetValue("true")

    ' Since we are just saving into a draft state, let's remove all the validation errors so we can save the form

    Errors.DeleteAll()

    ' Set our Workflow Action field here.

    xnWorkflowAction.SetValue("Save As Draft")

    Else

    xnInDraftMode.SetValue("false")

    ' Set our Workflow Action field here.

    xnWorkflowAction.SetValue("Submit to Records")

    End If

    ' Determine which connection to use based upon whether or not we are in draft mode.

    If LCase$(xnInDraftMode.Value) = "true" Then

    dataConnectionName = "Save as Draft"

    Else

    dataConnectionName = "SharePoint Library Main Submit"

    End If

     

    Let me know if that helps. Thanks!

    -Jason Hamlin

  • 03-11-2011 08:30 AM In reply to

    Re: Save without all required fields filled

    Thank you for the quick reply. There are a few things I am not following sure on though.

    First, "create one new field, Savable.  I use a boolean."  did you set this to blank? Would it be bad if it was just a "text" type?

    Second, "In the rules for opening the form, add a rule, Set Savable to false. The rule should set the field Savable to False.  This will turn on the validation every time you open the form" Not sure what you are meaning here. Would it be better to just set the value of the field to default to False! Then I could also put a rule on the "submit" button to set the field to true then it would run correctly also right?

    The reason I ask is becuase I dont think we have any rules running at form load. Or maybe if you explained or could show example of what you mean there I could fully understand better. But thanks for the suggestion.

  • 03-11-2011 08:40 AM In reply to

    Re: Save without all required fields filled

    I would use a boolean just because it only true/false, you can't forget what it is. You can use text, but then you have to remember if you put True or true, which are not the same in the text world.

    I would set the field to false or you could leave it blank, since the Save button and rules on open will set it anyways.

    The reason for using the rules on open is that if the user saves multiple times, and you don't set the validation back, the user doesn't know what they have to fill out. So they may never get the Submit button to show up since they don't know what all is needed to fill out.

  • 03-11-2011 01:58 PM In reply to

    Re: Save without all required fields filled

    Thank you so much for the help. It works great and does exactly what I need. I just am having some troubles with checkbox requirements, hopefully I can work around those on Monday, but this was excellent. thanks for the reply and information. Like I said, I have been searching for a while and could not find anyone that had what you posted. This I thought would have been something asked before. Thanks again.

  • 02-01-2012 09:50 AM In reply to

    Re: Save without all required fields filled

    Just want to clarify this, that you made all the fields *not required* FIRST then you add a Validation rule to EVERY required field and add a condition based on the Savable field.

    Is my understanding correct?

  • 02-01-2012 10:59 AM In reply to

    Re: Save without all required fields filled

    Yes, thats correct.

    I attached an example of how it works.  The on open rules are not in it, but the field rules are.

  • 02-01-2012 01:46 PM In reply to

    Re: Save without all required fields filled

    Thanks, some colleague of mine read your post and thought the Savable field and the rules somehow could cause the existing validation to be bypassed. My understanding is that the validation rules are *additional rules* on top of the requirements at the field level, if we are not meeting the requirment we set up at field level, the validation rules won't be able to help us fool it into believing we have met the requirements.

     thx again.

  • 02-01-2012 02:13 PM In reply to

    Re: Save without all required fields filled

    The example may have hindered more than helped since I didn't include any other rules in it.
    This rule is in addtion to whatever rule you may already have in place.

    If you have a validation that says "this field is not equal to Blue" the savable would be an AND to that validation.
    "this field is not equal to Blue and savable is not equal to true"
    This makes it so that you can bypass the validation if and only if the savable field does not equal true.

    If you have multiple validation rules, you will need to put the 'and savable' into each validation for it to work correctly.

    We use this kind of rule to save and then continue work the same form later before they get submitted to the final authority.
    Because of the way we use it, the savable field is only false when we want to submit it (it turns on all validation).

    I put up a new example that may explain it a bit better.

    Try to think of Saving and Submitting as two seperate acts in this example.
    Saving - unfinished form.
    Submitting - finished form. 

  • 05-17-2015 08:05 PM In reply to

    • royabc
    • Not Ranked
    • Joined on 05-17-2015
    • Posts 2

    Re: Save without all required fields filled

     Could you please attach a sample? I'm stuck trying to replicate this. Thanks so much.

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