Help with Preventing duplicate entries on field before form is submitted - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Help with Preventing duplicate entries on field before form is submitted

Last post 03-26-2014 02:24 PM by Andrew LaForge. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-25-2014 11:32 AM

    Help with Preventing duplicate entries on field before form is submitted

    Hey all, So I'm really struggling on how to properly set this up, and not sure if anyone has a quick way to complete this..I have found several articles on here, but nothing with specifics on how the rules need to be created I have a field 'Account Number' .. before the form is submitted, I need to query the same SP list and make sure that account number does not already exist.. and if it does, kick an error. I already setup to query the data connection but everywhere I research mentions needing to setup an expression .. and I can't find any specifics on what to use for the actual expression conditions.. Any help would be very appreciated!!! Thanks -Andrew
  • 03-26-2014 02:40 AM In reply to

    Re: Help with Preventing duplicate entries on field before form is submitted

     Maybe I've missed the complexity of your account number,

    Yet assuming your account number is in a column within your list which you are querying, why not do the following.

    On your form you'll have a field where an account number is input into (in my test it was a simple number). i.e. New Account Number

    You'll have a section, which has text in it i.e. Account number already exists, please choose another one.(Make if very obvious for your end users).

    Attached to the section above is another field (Existing Account Number), which is not on the form, but used for "math". default value of 0

     You could use a button (next to or underneath your New Account Number field) with several rules on it

    1.  Reset field Existing Account Number to 0

    2. Quwery your sp list

    3. Condition - New AccountNumber = Account Number

    Set Field Value Existing Account Number = 1

    Then on your section (Existing Account Number) have a formatting rule to hide the section if Existing Account Number IS NOT EQUAL to 1.

    On you button with the rule, make sure that if rule 3 is met, any further rules are not allowed to run.

    You could hide a separate submit button until the account number has be checked and verified.

     

    It doesn't have to be a section that hides, you could switch to a view to make it very obvious. with a back button (switch view) to the previous view.

  • 03-26-2014 02:24 PM In reply to

    Re: Help with Preventing duplicate entries on field before form is submitted

    thanks a lot for the suggestion, I'm going to try that.. I have it setup on another form to basically just include a link which pulls up the column from the SP list and allows the user themselves to check for a duplicate (not really how I wanted it setup, but all I thought of as a workaround) I'll let you know how it goes once I have time to create everything.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.