Submit button problems - InfoPath Dev
in

InfoPath Dev

Submit button problems

Last post 04-27-2011 09:23 AM by dms.WebDev. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-27-2011 08:21 AM

    Submit button problems

    I have a button control that submits a Travel Request form to SharePoint 2007 form library.  A custom C# workflow is attached to the form once it's submitted and is driven by the forms Status.  When the Submit button is clicked, the form's Status changes to Awaiting Approval  and the button becomes hidden and other buttons (approve or reject) appear.  Other buttons come and go as the status changes.  

    Back to the first button that appears, the Submit button: if there are Data Validation errors on submit button click, the form does not submit and the status still changes.  This is confusing to the user because they have to find and fix the error to submit the form, but the button goes away.  If they click the built in submit button from the menu bar, they are prompted to save the form  and name it which is not desirable because it will override the auto generated file name in place.

     How do I write a rule that does this:
        If data validation errors then don't change the status and don't submit the form

  • 04-27-2011 09:23 AM In reply to

    I solved this by creating the following rule.  Hopefully it will help someone else who is a newbie.

    Note that although I have 11 required fields  I chose to set rules on only the 4 fields that are likely to be the culprits.

    Set Condition:
     txtField1 is blank or
     txtField2 is blank or
     txtField3 is blank or
     txtField4 is blank or

    Action:
     Set a field's value: Status = "Request"
     Show dialog box message:
      "Actual travel dates or Event dates are blank. 
      Please revisit section A1 and B1 to ensure START and END dates are entered and click Submit button again.
      (A message box will follow this message: "Some Rules were not applied" . Click OK to close it and continue.)"

    The problem with this will be if any of the other 7 required fields are blank, the submit button resorts to its old behavior so I may have to go back and add all fields to the rule.  There is a limit of 5 conditions on a rule so I suppose I would have to create 3 sets of rules to accomodate all 11 text fields being blank.

     Also it might be better to remove the "Cannot be blank" check mark in a fields properties to avoid the 2nd message popping up (if a rule/condition catches it that is).

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