Unanswered SPDataSource CrossList query: Multi-selection User fields missing

  • Wednesday, April 09, 2008 2:18 PM
     
     

    I'm currently running into an issue using a DataFormWebPart with an SPDataSource that performs a CrossList query. Here are the details of my problem:

    • The query returns data from a list named "Project" that exists in identical form on all sub-sites.
    • Each Project list contains a single item that describes the project details for the sub-site.
    • The Project list definition is derived from the Custom List template. It has a single content type named "Project" that is defined in the root site.
    • The main page in the root site contains a DataFormWebPart that shows a listing of the project details gathered from all of the sub-sites.
    • The DataFormWebPart performs a CrossList query to gather the details from each Project list. The query is restricted to list items with a content type of Project. The example below shows the SPDataSource definition from the web part. NOTE: I've highlighted the CAML query and removed the escaping to make the query easier to read.

    Code Snippet

     <DataSources>
      <SharePointWebControls:SPDataSource runat="server" DataSourceMode="CrossList" UseInternalName="true" selectcommand="

     

    <View><Webs Scope="Recursive"></Webs><Lists ServerTemplate="100"><WithIndex FieldId="{c042a256-787d-4a6f-8a8a-cf6ab767f12d}" Type="Text" Value="Project"></WithIndex></Lists><View><Query><OrderBy><FieldRef Name="Title" Ascending="TRUE"/></OrderBy><Where><Eq><FieldRef Name="ContentType"/><Value Type="Text">Project</Value></Eq></Where></Query><ViewFields><FieldRef Name="ID"/><FieldRef Name="Title"/><FieldRef Name="ProjectDescription"/><FieldRef Name="FileRef"/><FieldRef Name="PermMask"/><FieldRef Name="ProjectManager"/><FieldRef Name="ProjectBeginDate"/><FieldRef Name="ProjectCompletionDate"/><FieldRef Name="Created"/><FieldRef Name="Author"/><FieldRef Name="Modified"/><FieldRef Name="Editor"/><FieldRef Name="ProjectPhase"/><FieldRef Name="ProjectStatus"/><FieldRef Name="FileDirRef"/><FieldRef Name="ProjectSponsor" Nullable="TRUE"/></ViewFields></View>

     

    " id="Projects1"><UpdateParameters><WebPartPages:DataFormParameter PropertyName="ParameterValues" ParameterKey="ListID" DefaultValue="B63ABAD4-8FF0-4E07-9675-EE7AE6DE388C" Name="ListID" />
      </UpdateParameters><DeleteParameters><WebPartPages:DataFormParameter PropertyName="ParameterValues" ParameterKey="ListID" DefaultValue="B63ABAD4-8FF0-4E07-9675-EE7AE6DE388C" Name="ListID" />
      </DeleteParameters><InsertParameters><WebPartPages:DataFormParameter PropertyName="ParameterValues" ParameterKey="ListID" DefaultValue="B63ABAD4-8FF0-4E07-9675-EE7AE6DE388C" Name="ListID" />
      </InsertParameters><SelectParameters><WebPartPages:DataFormParameter PropertyName="ParameterValues" ParameterKey="ListID" DefaultValue="B63ABAD4-8FF0-4E07-9675-EE7AE6DE388C" Name="ListID" />
      </SelectParameters>
      </SharePointWebControls:SPDataSource>
     </DataSources>

     

     

    The ProjectSponsor field is a Person/Group site column. The query works fine if ProjectSponsor allows a single selection. However, if the field is defined to allow multiple selections, the query always returns a NULL value for the ProjectSponsor on all items; other column values are reported normally. If the site column is changed back to a single-selection field the query starts working again.

     

    You may notice that the <FieldRef> element includes the Nullable="TRUE" attribute; without this attribute, the query returns zero items.

     

    I haven't been able to find any information related to this specific problem. MS Knowledge Base article KB946484 ( http://support.microsoft.com/kb/946484 ) is similar but doesn't appear to address my issue, which is related to the use of multi-selection columns.

     

    Any ideas for solutions or workarounds other than the obvious (don't use multi-selection Person/Group fields)?

     

All Replies