Validation against Secondary data source repeating table - InfoPath Dev
in

InfoPath Dev

Validation against Secondary data source repeating table

Last post 02-04-2009 12:26 AM by Mel Clemente. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-31-2007 07:28 AM

    Validation against Secondary data source repeating table

    Hi

    At the moment I am taking 2 steps forward and 1 step back - (I think better than a few days ago when it was 1 forward and 2 back !)

    I have a field (Name) which I want to ensure does not exist in a secondary data source (SName) (multiple records).  I do not know the case of either of the Name fields, so I need to use the translate function to get each of them in the same case.

    Initially I am ignoring the case problem and just trying to validate Name against SName.

    I have gone into validate and have selected Name is equal to SName - I have then previewed the form and I can enter ANY value in Name and validation does not kick in. ie Fred exists in SName and entering Fred in Name does not cause a validation error.

    I have gone into RULES and have selected Name is equal to SName - I have then previewed the form and I can enter ANY value in Name and validation does not kick in. ie Fred exists in SName and entering Fred in Name does not the rule to be triggered.

    I have gone into validate and have used the expression . = xdXDocument:GetDOM("NameList")/dfs:myFields/dfs:dataFields/d:NameList/@SName  I have then previewed the form and I can enter ANY value in Name and validation does not kick in. ie Fred exists in SName and entering Fred in Name does not cause a validation error.

    I have gone into validate and have used the expression . = xdXDocument:GetDOM("NameList")/dfs:myFields/dfs:dataFields/d:NameList//@SName  I have then previewed the form and I can enter ANY value in Name and validation does not kick in. ie Fred exists in SName and entering Fred in Name does not cause a validation error.

    I have created another field with a default value of @SName[. = Name] - and this does not show a value when it should

    I was hoping that once I hat got the initial validation working I could insert the translate later.... I am not having much luck here with the simpler option- am I going on the right track ?

    Catharine

  • 08-21-2007 11:58 PM In reply to

    Re: Validation against Secondary data source repeating table

    Hi Catharine,

    Sorry for the delay in responding. Is the SName field repeating or an element of a repeating group? If so, you'll need to use current() to properly select it. For the secondary data source checks you may need to eval through them since there will be more than one. This will likely require some code. If you were filtering, it would be different since InfoPath has out of the box filtering, but you are doing the opposite - exclusion. It's easy to do this with code, but probably difficult to do this using rules.

    If you'd like some help, send us your XSN and buy some support credits from our store on Qdabra.com. We'll put someone in touch with you asap to get the code written so that you are unblocked.

    Best regards,

    Patrick Halstead
    Project Manager at Qdabra
  • 02-04-2009 12:26 AM In reply to

    Re: Validation against Secondary data source repeating table

    Hi Catharine,

    I'm sorry you're having issues in your data validation. Please do check out this blog: http://www.infopathdev.com/blogs/mel_balsamo/archive/2009/02/04/comparing-items-in-a-list-against-an-updated-data-source.aspx. Hope it helps.

    Cheers,

    Mel Clemente
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

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