Kentico,Sharepoint和ViewFieldsOnly属性

时间:2019-07-19 03:24:26

标签: kentico kentico-12 kentico-mvc

我想在我的Kentico SharePointView中使用GroupBy语句按MeetingID进行分组,例如:

    private List<string> viewGroupFields = new List<string>
        {
            SharePointDocumentColumns.MeetingID
        };

    SharePointView view = new SharePointView
    {
        Scope = SharePointViewScope.RECURSIVE_ALL,
        QueryInnerXml = @"<Where>        
                                    <And>                                        
                                        <And>
                                            <Eq>
                                                <FieldRef Name='FSObjType'/> 
                                                <Value Type='Counter'>0</Value>
                                            </Eq>
                                            <Geq>
                                                <FieldRef Name='Modified'/>
                                                <Value IncludeTimeValue = 'TRUE' Type = 'DateTime'>2016-01-01T15:55:52Z</Value>           
                                            </Geq>  
                                        </And>
                                        <IsNotNull>
                                            <FieldRef Name='Title' />                                              
                                        </IsNotNull>
                                    </And>
                                </Where>
                                <GroupBy>
                                  <GroupBy Collapse='True'>
                                     <FieldRef Name='MeetingID' />
                                  </GroupBy>
                                </GroupBy>
                                <OrderBy>
                                    <FieldRef Name='DocID' />                                       
                                </OrderBy>",
        ViewFields = viewGroupFields
    };

    DataSet results = listService.GetListItems(spLibraryName, spLibraryRelativeUrl, view, null);

理想情况下,结果应仅包含ViewFields中指定的MeetingID字段。 但是,我也收到了SharePoint内部列(Created,Modified等),这些列阻止获得正确的分组结果。

我读到有一个ViewFieldsOnly property强制只返回ViewFields中列出的列。 在CMS.SharePoint类中是否也可用?我需要用它来处理我的库。

谢谢

西尔万

0 个答案:

没有答案