Hi, in my Lotus Notes agent, I temporarilycreated some documents using a new form (with a richtext field in the form), and in the end of the code, I have “Call TempDoc.Remove(True)”, when the program execute this line of code, I got error “Notes error: No documents were deleted”, then I commented out this code to let the document saved in the current database, so I manually delete those documents created by my program by click Delete key, but I got the same error “No documents were deleted”, I have Manager access with delete option in the database ACL,
Does anybody know why I got that error?
By the way, if I created a new document by using the default form which is not the form used in my program above, then I can delete it.
So, the question may be: what kinds of documents created in the notes database can NOT be deleted by a id with Manager and Delete option?
Subject: Notes error: No documents were deleted, why
When you state that you ‘created temp docs with a rich test item…’ - did you ever call tempdoc.save? If the document wasn’t saved it can’t be deleted.
If it WAS saved, when you go back to delete it, how are you getting a handle on the document?
I guess my real question is - when the agent is complete - and ‘no documents deleted’ - are the documents actually found in the database?
update - i missed part of your issue -
Is there a Querydocumentdelete script in your database that limits deletes to a specific form? (Database script)
Subject: RE: Notes error: No documents were deleted, why
- I have checked Querydocumentdelete from my Database script, there are no working codes there (the original was commented out).2. I checked the codes again, yes, the tempdoc did saved, but it was saved as MIME type, and the ContentType = “multipart”,
And from the debug mode, I can see the tempdoc was created, but I tried to add an variable like this:
Dim d As Integer
d = newDoc.Remove(True)
This caused that error again, so I can not delete the document from my agent codes, and same error when I hit delete key menually.
no sure if this caused the problem, any idea?
Subject: temp doc
You say that in debug, you can see that the doc was created, but, if you open the database (notes client) can you actually see the document? What happens when you try to open the document?
Subject: RE: temp doc
yes, when I open the database in notes client, I can see those documents, when I click to open it, it shows in notes client with the Form (which is new form with a simple Richtext Body field in it) I used in my agent code.But I can not delete it menaully for those documents by hitting Delete key and F9 to refresh, I got that error message. any idea?
Subject: RE: temp doc
Nothing definite, sorry.
When you create the document via script, are you assigning a value to a ‘Form’ field? Perhaps there is an issue trying to delete a form with no form name. (just grasping at straws).
Did all this happen today during the same session? In other words, have you restarted your notes client since this started happening?
(I’ve had cases where the client gets confused during testing and a restart cleans it right up)
Did you modify the querydocumentdelete script? You might try modifying it - closing & restarting your client after.
That’s all I can think of at the moment…
Subject: RE: temp doc
Yes, the Form name is assigned properly, I also can see the Form name item from the document property. The form is very simple, only has one richtext “Body” field in it. Restart notes client does not fix the problem.
Only documents created by my agent code have this issue.
Querydocumentdelete script library is clean, nothing there.
can not find anywhere else.
But one thing I can tell is: before saving the tempdoc, I set
session.ConverMime = True, no sure it this cases the problem.
Subject: session.ConverMime = True
I assume you mean ‘session.ConvertMime = True’ (not ‘session.ConverMime = True’)
I don’t have the R6 or R7 help files in front of me, but R8 help states:
‘This setting is initially True but persists across Notes client events. In general, if you change this setting, you should restore it before exiting.’
What happens if you comment that line out of your code? Or, can you at least check the initial setting, and set it back before saving the document?
Subject: RE: session.ConverMime = True
Sorry for the typo, yes , it is ‘session.ConvertMime = True’
I do have ‘session.ConverMime = True’ before the doc save and 'session.ConverMime = False after doc save.
Subject: What do you get if you check IsNewNote before attempting to delete it?
lag = notesDocument.IsNewNote
Subject: RE: What do you get if you check IsNewNote before attempting to delete it?
just checked it, lag = notesDocument.IsNewNotethe lag = 0
Subject: This might be related to the content of the RTF
Just duckduckgo’d the error and found this from 1999…
http://www-10.lotus.com/ldd/46dom.nsf/dfcbf9e2586b6dce852569fc0075882b/22dec8961d1dbaa48525671d004deb64
What happens if you flush the content of the RT field, resave the doc, and then try and delete it?