Closed varunsree closed 4 years ago
Hi @varunsree,
It should be possible by checking it in the usual for SP API way, which is not empty CheckoutUserId
field value. For that purposes metaFields
property can be used,
If not null then checked out.
Thanks for your quick update. But I am facing an issue regarding the response. Always got null from the metadata response. I Mean always return null if the file is open/not
If a status is not affected in metadata obviously there is no way to track it at all. You can use the "require checkout to edit" option, but this is not connected with the library.
Just wondering, what scenario are you covering?
Actually I want to update the SharePoint files at some point in time, So at that time, the file is opened in the browser I got the error message like 'File is Locked'. So I want to check that the file is opened before the update operation is performed.
Not sure that there is a way to understand if a file is locked before an update request sent and 423 HTTP Status code is received back, at least can't recall anything like this. Anyways, it should not be a part of documents fetching with SPPull (as time delay before a file is fetched and is locked to editing can be serious) but an update logic, relying on ETags, forcing checkouts while editing, etc. if a process involves many actors changing the docs.
Going to close this.
Is it possible to know the file status is Locked or not?