Hi there,
got a ticket today from users of a Notesdatabase on our primary apps-server which can't delete obsolete documents any longer.
They showed me their problem and indeed each time one tries to delete the selected document in the view one gets a message box "Document locking is enabled. You must lock the document before deleting."
Any ideas what this is exactly good for ? And how to switch it off ?
The QueryDocumentDelete event in the Database Script is empty
Is that "feature" only working in the UI ?
Sincerly
Jochen "Joe" Herrmann
ADDENDUM (08.12.2022) :
I have suggested to change this behaviour now in Domino-Ideas. Please support it:
Hi Joe
If you do not have manager access to a db that has the "Document locking" Database property enabled, you will not be able to delete documents, even if you have delete document rights as per the db ACL. In order to delete documents from a db that has doc locking enabled, you must first lock the document before you delete the doc
Ok,
I have suggested to change this behaviour now in Domino-Ideas. So please support it:
Hello Sudhakar,
thanks for your reply.
I do not understand this logic.
Either you have the right to delete documents or not and the document is locked by someone else or it is not.
If a document is locked by someone else, then you cant delete it - the server will prevent it, right ?
When I sent the server the command to delete a document, the server can see whether its locked by someone else or not. So what exactly is the locking before deletion process good for ?
TIA,
Joe
Hello Sudhakar,
would under these cirumstances the following code work ?
Set coll=db.Search(Formula, dt, 0)
coll.Removeall(false)
because there is no colll.lock command available, right ?
Or would I really have to create a LS-loop to lock every document in that collection before I can call Coll.removeall(false) ?
Kind regards,
Joe
Hi Joe
If you have Manager access to the db, you should be able to delete those documents. Otherwise you can use below code to unlock the documents.
https://help.hcltechsw.com/dom_designer/12.0.0/basic/H_EXAMPLES_UNLOCK_METHOD_DOC.html
Hello Sudhakar,
I start to think that there is a misunderstanding. The documents our employees tried to delete were not locked at all - I verified it. In case the documents are locked I know what to do. But this happend to definitely not locked documents.
Kind Regards
Joe
Hi Joe
Yes. I understood. Though the document is not locked, users with out Manager rights has to lock the document before deletion.
You can use below code to lock the same.
https://help.hcltechsw.com/dom_designer/9.0.1/appdev/H_EXAMPLES_LOCK_METHOD_DOC.html
Hello @Jochen Herrmann
If the document locking is enabled on database properties, please disable it and then ask user to delete the document.
-> Please make sure that "Allow Document Locking" is unchecked in DB properties.
-> Then ask user to delete the document from DB and check the situation.
Regards,
Chaitanya Y
Hello Chaitanya Y,
this is, of course, an option. But as this DB is used by more than one user it would open the chance that 2 users would edit the same document - replication conflict. To prevent this, the record locking is needed.
Thus I will have to write a backend agent that has the necessary rigths to delete documents and transfer the documents from the user in a folder or similar.
Unfortunately the intuitive way of deleting documents in Notes is for DBs with locking not working. Would really like to know why this way is blocked.
To verify how it was in the past I asked to setup a pc with an old Notes 9.x version.
Kind Regards,
Joe
Ok, verified. In a Domino V9 server and Notes 9 client it was indeed the same problem.
Guess have to add this to the Product Ideas Portal