InfoPath XML Filter - InfoPath Dev
in

InfoPath Dev

InfoPath XML Filter

Last post 10-26-2010 09:38 AM by Jimmy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-26-2010 08:44 AM

    InfoPath XML Filter

    I am writing a filter for an XML data connection to filter out status of Pending, employee of current employee and date (WeekEndingDetail) of < today.  I got the status and the employee working, but I can not get the filter to work for the date (WeekEndingDetail).  I am not sure if xDdate is the correct format or item to use.  Thanks.

    public void Search_Clicked(object sender, ClickedEventArgs e)

    {SetUserNameOptions(); }private void SetUserNameOptions(){FileQueryConnection q = (FileQueryConnection)this.DataConnections["AllocDetail xml filter"];q.FileLocation = q.FileLocation + "&FilterField1=Status&FilterValue1=Pending&FilterField2=Employee&FilterValue2=" + GetUserNameValue() + "&FilterField3=WeekEndingDetail&FilterValue3<xdDate:Today()";q.Execute();}private string GetUserNameValue(){XPathNavigator nav = this.CreateNavigator();string filterValue = (string)nav.SelectSingleNode("/my:myFields/my:QueryAllocDetail/my:AllocDetail/my:Employee", this.NamespaceManager).ValueAs(typeof(string));return filterValue;}

     

  • 10-26-2010 09:24 AM In reply to

    I'm assuming you are using SharePoint for the workflow - what is the column data type for WeekEndingDetail in SharePoint?  Have you tried changing the data type in SharePoint to see if that fixes it?

  • 10-26-2010 09:38 AM In reply to

    I very much doubt xdDate:Today() is going to work here.  How about:

    q.FileLocation = q.FileLocation + "&FilterField1=Status&FilterValue1=Pending&FilterField2=Employee&FilterValue2=" + GetUserNameValue() + "&FilterField3=WeekEndingDetail&FilterValue3<" DateTime.Today.ToString("yyyy-MM-dd");

    And double-check that using < in a query string like this is actually allowed. 
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.