The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Hi @Nagarjuna B ,
To help you better ,can you share any code on this issue to help me reproduce the problem?
Based on my research and testing ,as a workaround, you can follow these code to get items have been checked out using CSOM :
static void Main(string[] args)
{
var ctx = GetonlineContext();
Web oweb = ctx.Web;
ctx.Load(ctx.Web, a => a.Lists);
ctx.ExecuteQuery();
var listName = "test";
List list = ctx.Web.Lists.GetByTitle(listName);
var items = list.GetItems(
new CamlQuery()
{
ViewXml = @"<View Scope='RecursiveAll'><Query>
<Where><IsNotNull><FieldRef Name='File_x0020_Type' /></IsNotNull></Where>
</Query></View>"
});
ctx.Load(items, a => a.IncludeWithDefaultProperties(item => item.File, item => item.File.CheckedOutByUser));
ctx.ExecuteQuery();
foreach (var item in items)
{
if (item.File.CheckOutType != CheckOutType.None)
{
Debug.WriteLine("File: " + item["FileRef"].ToString().Split('/').LastOrDefault());
Debug.WriteLine("Checked-Out By: " + item.File.CheckedOutByUser.Title);
Debug.WriteLine("Checked-Out User Email: " + item.File.CheckedOutByUser.Email);
Debug.WriteLine("Last Modified: " + DateTime.Parse(item["Last_x0020_Modified"].ToString()));
Debug.WriteLine("-----------------------");
Debug.WriteLine("");
}
}
}
My test result:
Hope it can help you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.