Secondary Datasource Filtering Problem - InfoPath Dev
in

InfoPath Dev

Secondary Datasource Filtering Problem

Last post 02-11-2009 08:10 AM by thebear98. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-10-2009 03:29 PM

    Secondary Datasource Filtering Problem

    Hi,
     I have an InfoPath/Sharepoint '03 form library datasource that returns all values for
    ProjNum and SubProjNum from the forms submitted there.
     I am now filtering this datasource to identify the max value of the
    SubProjNum's for a specific ProjNum (in order to increment by 1 for the next
    sub proj form).
     My assignment looks like this:
     NewSubProjNum = max(@SubProjNum[@ProjNum = ProjNum]) + 1

     ProjNum is a value in a field on the new form and displays fine.
     max(@ProjNum) returns the max(ProjNum) from the datasource fine.
     But filtering the datasource for the max SubProjNum where @ProjNum =
    ProjNum returns NaN.
    count(@SubProjNum[@ProjNum = ProjNum]) = 0, even though I can see the existing record in the form library.

     Can anyone see what I am doing wrong here?
     Any suggestions?
      Thx,
      Barry

  • 02-10-2009 10:02 PM In reply to

    Re: Secondary Datasource Filtering Problem

    Hi,

    Is the @ProjNum child of @SubProjNum in secondary data source? Once verify that. Also after selecting @SubProjNum, click on Filter data. There select the @ProjNum in the first drop down, is equal to in the second drop down and ProjNum (main  data source) in the third drop down. Click ok until all the windows gets closed.

    Swathip
    www.ggktech.com
  • 02-11-2009 07:08 AM In reply to

    Re: Secondary Datasource Filtering Problem

    @ProjNum and @SubProjNum are both fields returned by the secondary datasource.

    My setup is exactly as you describe it, but max(@SubProjNum[@ProjNum = ProjNum]) returns NaN.

    Could there be a type problem with the fields (i.e. max of an HTML string)? 

    Any help would be appreciated...

    Barry

  • 02-11-2009 08:10 AM In reply to

    Solution: Secondary Datasource Filtering Problem

     Turns out I had to call the number function for the form-side ProjNum value:
        Max(@SubProjNum[@ProjNum = number(ProjNum)])
     Hope this saves someone a few hours of anxiety...
      Thx,
       Barry
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.