Validation Problems - Bug?? - InfoPath Dev
in

InfoPath Dev

Validation Problems - Bug??

Last post 06-13-2006 12:38 PM by demian42. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-07-2006 05:34 AM

    Validation Problems - Bug??

    I was trying to validate a drop down box entry versus a secondary connection that requires 2 filters, i.e. the selected cost code must be in the validation table FOR THE SELECTED PROJECT. The reason for the validation is that the validation table may change prior to submitting the form. The following expression ALWAYS indicates bad data ...

    not(current()/@CostCode = xdXDocument:GetDOM("CostCodeDropDown")/dfs:myFields/dfs:dataFields/d:row/@CostCode[../@Project = current()/@Project and . = current()/@CostCode])

    In trying to troubleshoot this, I came upon this unbelievable behavoir ... if I enter that expression into an "expression box" it behaves exactly as I would expect (i.e. correctly). If I enter the EXACT same expression as the default value of a text box, it ALWAYS indicates true.

    Any thoughts??
  • 06-07-2006 11:37 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Validation Problems - Bug??

    Hi demain,

    Can you try out with two validations same as shown below

    not(current()/@CostCode = xdXDocument:GetDOM("CostCodeDropDown")/dfs:myFields/dfs:dataFields/d:row/@CostCode[../@Project = current()/@Project]

    not(current()/@CostCode = xdXDocument:GetDOM("CostCodeDropDown")/dfs:myFields/dfs:dataFields/d:row/@CostCode[. = current()/@CostCode])
  • 06-08-2006 05:34 AM In reply to

    Re: Validation Problems - Bug??

    I tried both of them, and then one at a time. For some reason they are always 'true'.

    A different attempt was to modify the data connection such that I only have one field to filter by the SQL was modified to select [Project] & "-" & [CostCode] AS ProjectCostCode and this was validated against this function ... concat(current()/@Project, "-", current()/@CostCode) ... failure again.

    Note that the concat function displays different results in a text box vs. expression box as described in my original post.
  • 06-08-2006 08:49 AM In reply to

    Re: Validation Problems - Bug??

    Is the CostCodeDropDown a DB connection? I know I have had trouble in the past with the DB putting an extra whitespace character at the end of a column and making that fail string comparison. To solve this, I used the normalize-space() method.

    I hope this helps, it sounds like a frustrating bug!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 06-13-2006 12:38 PM In reply to

    Re: Validation Problems - Bug??

    it is a DB Connection, but I filter data in numerous places (to set fields values for instance) and have no issues whatsoever. I ended up changing the database structure so that the validation is based on one field only - I needed to finish lol.

    I absolutely love this application and have developed many useful forms ... but I would be soooo much happier if they allowed ...

    unbound controls, i.e. combo boxes & such, where selections trigger events and data could be used without having to have that field in the database.



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