Data validation not working correctly for multiple fields - InfoPath Dev
in

InfoPath Dev

Data validation not working correctly for multiple fields

Last post 08-14-2013 09:11 AM by Doreen. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-19-2013 01:19 PM

    Data validation not working correctly for multiple fields

    I've got one field in my form called INVOICE_AMT.  I'm trying to require a non-zero value in that field.  There are 2 other fields that this is conditioned upon:  INVOICE_DETAIL and DNP.  Here's how it should work.

    If INVOICE_DETAIL is equal to CPF, APF, or HRB Simple AND
    DNP is equal to False AND
    INVOICE_AMT is equal to 0 OR
    INVOICE_AMT is blank

    Then the INVOICE_AMT field should be required to be more than 0.

    No matter what I do, I cannot get this thing to work.  Here's how my condition currently works:

     If this condition is true:

    INVOICE_AMT is less than or equal to 0 and
    The expression ../@INVOICE_DETAIL = "CPF" or "APF" or "HRB Simple" and
    DNP is equal to "False"

    It's screwing things all up and giving me the wrong validation.  I've tried this so many times, but I can't get it to work.  I'm in desparate need of some help on this one.

     

  • 04-21-2013 09:36 AM In reply to

    Re: Data validation not working correctly for multiple fields

    Maybe you need to add parentheses around the terms in your OR expressions to make sure that the entire OR is evaluated as opposed to just the first term. :)

    It's the same idea as in albebra - if your formula has multiplication and addition, you need to put parentheses around your plus signs... http://en.wikipedia.org/wiki/Bracket_(mathematics)

    Patrick Halstead
    Project Manager at Qdabra
  • 04-22-2013 10:34 AM In reply to

    Re: Data validation not working correctly for multiple fields

    Brilliant, but it didn't quite work.  What I figured out is that I needed to use an expression.  It ended up being:

    ../@INVOICE_DETAIL = "CPF" or ../@INVOICE_DETAIL = "APF" or ../@INVOICE_DETAIL = "HRB Simple"

     That seemed to make it check each variable and treat the whole line as one validation.

  • 08-14-2013 09:11 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Data validation not working correctly for multiple fields

    Thank you for your solution stormseeker75.  I was having similar problem writing the expression correctly.  Your solution made me realize I needed to use the xpath value in the express (i.e. ../my:fieldname)

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