0

收到此错误:ServerException 未处理,当我修复查询时,我在 SharePoint 上对其进行筛选时没有得到确切的结果。

<View>
<Query>
<Where>
<And>
<And>
<Or>
<Or>
<Or>
<Eq><FieldRef Name='BM_x0020_Status' /><Value Type='Choice'>Completed</Value></Eq>
<Eq><FieldRef Name='BM_x0020_Status' /><Value Type='Choice'>Not yet submitted</Value></Eq>
</Or>
<Eq><FieldRef Name='BM_x0020_Status' /><Value Type='Choice'>Completed</Value></Eq>
</Or>
<Eq><FieldRef Name='Approval_x0020_Month' /><Value Type='Text'>" + approvalmonth + "</Value></Eq>
</Or>
</And>
<Eq><FieldRef Name='PG_x0020_ID_x003a_Service_x0020_' /><Value Type='Lookup'>RPCS</Value></Eq>
<Eq><FieldRef Name='PG_x0020_ID_x003a_Service_x0020_' /><Value Type='Lookup'>PLM</Value></Eq>
</And>
</Where>
<OrderBy><FieldRef Name='BM_x0020_Status' Ascending='True' /></OrderBy>
</Query>
</View>
4

1 回答 1

0

你错过了一个 And 标签。

应该是这样的:

<View>
<Query>
<Where>
    <And>
        <And>
            <And>
                <Or>
                    <Or>
                        <Or>
                        <Eq><FieldRef Name='BM_x0020_Status' /><Value Type='Choice'>Completed</Value></Eq>
                        <Eq><FieldRef Name='BM_x0020_Status' /><Value Type='Choice'>Not yet submitted</Value></Eq>
                        </Or>
                        <Eq><FieldRef Name='BM_x0020_Status' /><Value Type='Choice'>Completed</Value></Eq>
                    </Or>
                    <Eq><FieldRef Name='Approval_x0020_Month' /><Value Type='Text'>" + approvalmonth + "</Value></Eq>
                </Or>
            </And>
            <Eq><FieldRef Name='PG_x0020_ID_x003a_Service_x0020_' /><Value Type='Lookup'>RPCS</Value></Eq>
        </And>
        <Eq><FieldRef Name='PG_x0020_ID_x003a_Service_x0020_' /><Value Type='Lookup'>PLM</Value></Eq>
    </And>
</Where>
<OrderBy><FieldRef Name='BM_x0020_Status' Ascending='True' /></OrderBy>
</Query>
</View>
于 2013-04-23T05:54:53.657 回答