New method CheckedOutFiles() is not returning results

MVP

Can someone confirm my findings, possible issue with the new CSOM (March release) and CheckedOutFiles() method? It is always returning 0 items. 

 

Expected or Desired Behavior
When requesting the Checked Out Files in the new CSOM 16.1.7521.1200 I don't get any results back. Eventhough I'm site collection admin on the site collection and within the document library where I request the files I have one checked out file.

 

Observed Behavior
I would expected the method Microsoft.SharePoint.Client.List.GetCheckedOutFiles() to return the checked out files. In this case, one file.

 

Steps to Reproduce
I used both the following PowerShell script, and C# to retrieve the checked out files.

 

$siteUrl = "https://m365x123456.sharepoint.com/sites/vendors"

$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$ctx.AuthenticationMode = [Microsoft.SharePoint.Client.ClientAuthenticationMode]::Default
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($loginname, $pwd)

$web = $ctx.Web 
$ctx.Load($web) 
$ctx.ExecuteQuery()

$list = $web.GetList("/sites/vendors/Shared Documents")
$ctx.Load($list)
$ctx.ExecuteQuery()

$list.Title

$files = $list.GetCheckedOutFiles()
$ctx.Load($files)
$ctx.ExecuteQuery()

$files.Count

 

 

Output: 0

Expected output: 1

 

SharePoint Client Browser (C#)

Below a screenshot of a preview version of the SPCB which retrieves the files via CheckedOutFiles(). The count is 0 (see #1). Even though the library contains 1 file which is checked out (see #2). 

 

SharePointClientBrowserPreview-CheckedOutFiles.png

7 Replies

Hi Bram, I quickly wrote a console app and I can confirm this behavior: always returning 0 here too...

 

 

@Vesa Juvonen do you have similar experiences from other users? 

This change is currently rolling out in the server side, so there might be some delays for the APIs to work like also noted in the CSOM release blog post. We need to get things out before we can enable the APIs.

 

If the issue still exists within upcoming week(s), we need to have a closer look on this and would suggest submitting an issue at http://aka.ms/spdev-issues, so that we can trace that using our official process. 

Thanks for the response. I'll keep monitoring the feature and see if it starts working in upcoming weeks. The SharePoint Client Browser is ready for checked out files, check out the latest release for SharePoint Online. 

 

Keep you posted on updates when it starts working ;)

It will give count only if Files are in "No Checked-in File version". For me it returns count but "TakeOverCheckOut" method not working.

Hi Paul, it's been a while. But what is your experience now? It looks I still have the same behavior.

Hi Bram, same here: still not returning the expected results...