Skip to main content

Search

How to query a sublibrary recursively?

Answered

Comments

2 comments

  • Christof Nussbaumer

    Hi Jelle Dijkstra

     

    There are two things in your caml to fix and you're right, there is an additional issue in the viewAttribute for recursive scope definiton.

     

    Filter for lookups:

    You have to use the attribute LookupId on your FieldRef if you want to check the lookup by ID.

    <Eq>
         <FieldRef Name="Link_Control" LookupId="TRUE" />
         <Value Type="Lookup">10</Value>
    </Eq>

     

    Filter for booleans:

    Boolean values are 0 and 1 in CAML of QueryList, not Yes and No.

    <Eq>
        <FieldRef Name="isEvidence" /><Value Type="Boolean">1</Value>
    </Eq>

     

    viewAttributes (scope):

    You don't have to use these extra escape characters (\) if you don't use same quotes for parameter string and content inside string. So just write this in the end of your expression:

    ..., 'ID', 'Scope="Recursive"')]];

     

    I hope I get all things to fix.

    0
  • Jelle Dijkstra

    Hi Christof Nussbaumer,
    Thanks for your reply and solution. I was able to query the sublibrary recursively.

     

    KR,

    Jelle Dijkstra

    0

Please sign in to leave a comment.