10-28-2021 11:01 AM
Looking for a way to query for locked documents of a particular type.
I've tried variations on this:
SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND ecm:lockOwner IS NOT NULL
including
SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND (ecm:lockOwner IS NOT NULL or ecm:lockOwner <> ' ')
To test the query syntax I am working in a pre-production environment where I know that some but not all of the documents of the desired types are locked. Regardless of how I word the query, I either get back all of the documents or none of the documents, not the desired subset.
Any suggestions or help is appreciated.
11-02-2021 10:26 AM
Hello,
Try with ecm:isCheckedIn = 0
to find locked documents 🙂
More on https://doc.nuxeo.com/nxdoc/nxql/#special-nxql-properties
Regards
11-02-2021 10:26 AM
Hello,
Try with ecm:isCheckedIn = 0
to find locked documents 🙂
More on https://doc.nuxeo.com/nxdoc/nxql/#special-nxql-properties
Regards
11-03-2021 09:31 AM
I tried your query and the first option worked correctly for me:
SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND ecm:lockOwner IS NOT NULL
That query returned the 1 document I had locked of the specified doctype in the NQXL.
If I use the option for isCheckedIn
then it returns all the documents of the specified doctype, not sure why but it doesn't seem to acknowledge that a locked file is checkedOut.
SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND ecm:isCheckedIn = 0
I tested this in my local environment which is LTS 2021 (hotfix 10). If your first query is not working, then maybe it has to do with the database you are using?
11-03-2021 09:35 AM
TBH I'm not sure if it was a database issue or something else, but whatever the case, some of these attributes such as ecm
11-02-2022 07:34 AM
Hi ! I've got exactly the same problem. What solution did you use ?
The second question will be : how to unlock ALL locked documents (yes ... I have to do this because another software has locked many of them ...)
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.