I have created a document library definition in which I want to insert a view that shows all documents which are checked out by me.
The declarative code is:
<View BaseViewID="140" Type="HTML" WebPartZoneID="Main" DisplayName="CheckedOutView" DefaultView="FALSE" MobileView="FALSE" MobileDefaultView="FALSE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/15/images/dlicon.png?rev=23" Url="Forms/Checkedout.aspx" Hidden="FALSE">
<Toolbar Type="Standard" />
<ViewFields>
<FieldRef Name="DocIcon"/>
<FieldRef Name="LinkFilename"/>
<FieldRef Name="Modified"/>
<FieldRef Name="Editor"/>
</ViewFields>
<RowLimit>20</RowLimit>
<Query>
<OrderBy>
<FieldRef Name="Created"/>
</OrderBy>
<Where>
<Eq>
<FieldRef Name="CheckoutUser"/>
<Value Type="Integer">
<UserID Type="Integer"/>
</Value>
</Eq>
</View>
Now what query should I write to list all documents that are checked out by me?
The reason behind achieving this by creating view is because I found one comment here. I created the view with the condition by UI and copied the declarative code by opening that view using SharePoint Designer. But not working in my case.
</Where>
tag Also answer by bcastilho is correct.