in

SharePoint University

Clean slate. Nothing but SharePoint.
Go, SharePoint!

How to filter Yes/No in SharePoint designer?

Last post 07-18-2008 10:22 AM by pdavis. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-07-2008 6:40 PM

    How to filter Yes/No in SharePoint designer?

    I am using sharepoint designer to modify my top level site master page. In the master page there is a query webpart. It queries the Page library under one of the subsite. In this library I inheritated a column called "IsNeverExpire". The type is caculated "Yes/No". 

    I can add a web part in SharePoint. The web part query this column. If the the "IsNeverExpire" equal to "Yes", the web part will display this Item. Everything works fine when I do this in SharePoint. However when I use designer to do the same thing in the query web part on the master page, It failed to recognize the "Yes" value. I tried different value like "True", "1". All have failed.

     How to query against calculated column with "Yes/No" in designer?   

     Thanks

    Filed under:
  • 07-18-2008 10:22 AM In reply to

    Re: How to filter Yes/No in SharePoint designer?

    I had the same problem and found there is a bug in the way SPD generates the SelectCommand for the DataSource when you use a Yes/No column for filtering.   I used CAML Builder to check the CAML Query and found the Type was generated incorrectly.  You can correct this manually in SPD by editing the source using the code view.  Just change the Type from 'Text' to 'Choice' and your filter should work fine:

    SharePoint gererated code:   

     <SharePoint:SPDataSource runat="server" SelectCommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;Share_x0020_My_x0020_Contact_x00&quot;/&gt;&lt;Value Type=&quot;Text&quot; 

    Changed code:

     <SharePoint:SPDataSource runat="server" SelectCommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;Share_x0020_My_x0020_Contact_x00&quot;/&gt;&lt;Value Type=&quot;Choice&quot;

Page 1 of 1 (2 items)

Need SharePoint Training? Attend a SharePoint Bootcamp!
Forum content (c) original posters. Everything else (c) 2008 SharePoint Experts, Inc.