Sie können mich buchen für:
Individuelle Schulungen für XPages, JavaScript und Appcelerator Titanium Software-Entwicklung für IBM XPages, Appcelerator Titanium (Mobile Apps iPhone, iPad, Android, Blackberry 10), Mobile Web und IBM Notes
Bug with encrypted documents and LotusScript NotesDocument.isEncrypted property - what do you think?
Julian Buss, July 23rd, 2010
Tags:  Development 
I found something by accident: let a collegue send you an encrypted mail.
Then write a LotusScript agent like this:

---
Dim session As New NotesSession
MessageBox "Selected document is encrypted: "+CStr(session.currentDatabase.Unprocesseddocuments.Getfirstdocument().isEncrypted)
---

Now perform the following two tests:

1.) Select the encrypted mail in the inbox and execute the agent. You will see that the .isEncrypted property is FALSE.

2.) Open the mail, then execute the agent against the open UIDocument. You will see that the .isEncrypted property is TRUE (as it should be).

From my point of view, this means:

- As soon as you access an ecrypted document with LotusScript and you got the handle to the document from a view, the document will be decrypted. If you save the document then, it will be saved DECRYPTED. You need to call .encrypt() by yourself again.

- You cannot test if a document is encrypted or not at all if you got the handle to the document from a view.

- The behaviour is different wether you got the document from the view or an open UIDocument.

I tested this with 8.5.1 and 8.5.2CD5. Can anyone confirm this with other clients? What do you think about this?
You can hire me.
See my Linkedin profile for details.

Thanks for reading and have a nice time here!

Please note my Apps for iPhone and iPad: NotesBook: takes your Lotus Notes Notebook (Journal) to your iPhone and iPad xpageswiki.com: huge XPages Tips & Tricks collection for iPhone and iPad