Domanda

I have share point list named "Documents" that contains (ID , title , parentID)

where parentID refer to same list and ID auto generated by share point.

I need to create CAML query that select all documents that parentID equal ID

È stato utile?

Soluzione

Maybe you can create a computed field in your List where you do the compare like:

AreIdEquals: [ID] = [ParentId]

And then use:

<Query>
   <Where>
      <Eq>
         <FieldRef Name="AreIdEquals" />
         <Value Type="Boolean">1</Value>
      </Eq>
   </Where>
</Query>

from here: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/ab303453-dfd6-46c4-888a-e15d233c8e57/compare-two-fields-in-caml-query

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top