문제

I have a requirement of iterating multiple tasks list under SharePoint sites and sub-sites. I am using SPSiteDataQuery for achieving this. I am having an issue in fetching the data when the column is of type look-up. I am using following code:

query.ViewFields +=FieldRef Name=\"Predecessors\" Type=\"Lookup\" Nullable=\"TRUE\" /;

(Have removed < and " symbol as it is blocking the code)

This fetches all the other columns in the datatable but the value of column Predecessors is always blank for all the rows.

Any pointers in this regard will be highly helpful.

Cheers Chitranshi | SharePoint Consultant| Mindfire Solutions

도움이 되었습니까?

해결책

SPSiteDataQuery does not support multiple value look up columns. However, one can filter the results using SPsiteDataQuery on look up column.

In order to get the values of look up column use SPQuery to iterate through each and every lists which you can get through the SPSiteDataQuery.

In my approach I got the list ids of various lists in my sites and sub-sites using SPSiteDataQuery and using those list ids I fetched the list and the corresponding values for the look-up column using SPQuery.

Cheers Chitranshi | SharePoint Consultant| Mindfire Solutions

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top