Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using the following Query to retrieve the latest documents of the current user:

<Where>
    <And>
        <Eq>
            <FieldRef Name='FSObjType'></FieldRef>
            <Value Type='Text'>0</Value>
        </Eq>
        <Or><Eq>
                <FieldRef Name='Author' />
                <Value Type='Integer'><UserID/></Value>
            </Eq> 
            <Eq>
                <FieldRef Name='Editor'/>
                <Value Type='Integer'><UserID/></Value>
            </Eq>
        </Or>

            </And>
</Where>
<OrderBy>
 <FieldRef Name="Modified" Ascending="FALSE"/>
</OrderBy>

It is failing if the total number of documents in the site collection is higher than the threshold limit, even if the return result of the above query is only a few documents.

How to change the above query so that i don't risk exceeding the threshold.

Example, user1 has changed 5 documents in a list that contains 7000 documents. i want to display those 5 documents using the above query. If the list threshold is less than 7000, i get an exception. How to change the above query so not to exceed the threshold limit?

share|improve this question
add comment

1 Answer 1

Pretty sure there's a rowLimit to apply. You should be able to add this using this element in CAML

<RowLimit>10</RowLimit>

You can see how to apply this on MSDN.

EDIT:

Per your comment below, I think perhaps the ContentIterator is more what you need (code sample included). This should allow you to iterate over each matching item.

share|improve this answer
    
I believe rowlimit will execute after getting the result, which has no effect, no? –  Zee99 Mar 28 '11 at 14:26
    
I suspect you're right. I'll share other thoughts in a different answer. –  Neil Richards Mar 28 '11 at 16:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.