197 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Appending MIME item to NotesRichTextItem
Mon, Aug 7th 2017 3
Strange decision within IBM Verse update for June of 2017 on Android devices
Mon, Jun 12th 2017 7
The application requires com.ibm.xsp.extlibx.library. This library cannot be found.
Wed, May 24th 2017 5
Great news about BM Notes/Domino 9.0.1 Feature Pack 8
Fri, Jan 27th 2017 5
How to set Workspace as default homepage in IBM Notes client
Wed, Oct 26th 2016 16
Avoid processing items as both NotesItem and NotesMIMEEntity objects concurrently.
Thu, Jul 21st 2016 7
Third level in "Application links" section of Xpages Application Layout, WTF?
Sat, Jul 16th 2016 4
Top 10
How to set Workspace as default homepage in IBM Notes client
Wed, Oct 26th 2016 16
How to focus Lotus Notes window (standard version)
Wed, Dec 17th 2014 12
No such session or session has been closed
Sun, Nov 2nd 2014 12
If you can't remove lotus notes database icon from workspace
Wed, Sep 10th 2014 8
Corrupted unread list in Mail database caused "This database cannot be read due to an invalid on disk structure"
Thu, Jul 17th 2014 8
IBM Lotus Notes and Ctrl+Break on new laptops without button "Pause/Break" on keyboard. Is it familiar to you? :-)
Thu, May 29th 2014 8
NotesItem.Type = 256 causes "Variant does not contain a container"
Sat, Jul 26th 2014 7
NotesAgent.Runwithdocumentcontext() - cool thing
Thu, May 29th 2014 7
@Text(value; "*") - undocumented parameter "*" for @Text() function
Sun, Mar 23rd 2014 7
Be care with @Domain part when you deal with user names
Tue, Sep 1st 2015 7


Avoid processing items as both NotesItem and NotesMIMEEntity objects concurrently.
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
   

Hi guys

May be this will save a day to someone.

Let's imagine you need to send email with HTML inside.
In most of cases you would need to use NotesMIMEEntity class and probably some other MIME-related classes to build mail Body. Though it is possible to use the same classes to define Subject, SendTo, CopyTo and other mail headers people often use usual NotesItem-based syntax for the rest simple mail parameters.

However very important point is that as soon as you used NotesMIME-class you can NOT use NotesItem-based syntax until you close all NotesMIME entities.

So, if you write something like below, it will be rather OK

....
Set mailDoc = db.createdocument
mailDoc.Subject ="blablabla"
mailDoc.SendTo ="test@gmail.com"

Set mime = mailDoc.CreateMIMEEntity()
.......
call maiDoc.send(false)

However, if you do it in another order you will reap problems sooner or later

....
Set mailDoc = db.createdocument
Set mime = mailDoc.CreateMIMEEntity()
.......
mailDoc.Subject ="blablabla"
mailDoc.SendTo ="test@gmail.com"
call maiDoc.send(false)

The last example can even work when you try it, but then after some time users may complain about empty mail Body or something else.

If you really need to work with mail NotesItems after you used NotesMIME-classes you have to close all MIME entities first, for example, using method NotesDocument.CloseMIMEEntities.

Actually, everything I said here you can find in description of NotesMIMEEntity class in Usage part that I personally read not carefully enough.

---------------------
http://ypastov.blogspot.com/2016/07/avoid-processing-items-as-both.html
Jul 21, 2016
8 hits



Recent Blog Posts
3
Appending MIME item to NotesRichTextItem
Mon, Aug 7th 2017 1:59p   Yuriy Pastovenskyy
Hi guys May be this will save someone's day. The story: Some external UI posts HTML-data to Notes. That HTML has to be added to NotesRichtextItem. 1) When I tested simple case manually all worked OK: 1.1) Here is my Notes form 1.2) I put some data in Notes document and save it 1.3) Then I run an agent over this document with code like Sub Initialize Dim s As New NotesSession Dim doc As NotesDocument Dim rt1 As NotesRichTextItem Dim rt2 As NotesRichTextItem Set doc = s.Documentconte
7
Strange decision within IBM Verse update for June of 2017 on Android devices
Mon, Jun 12th 2017 3:41p   Yuriy Pastovenskyy
Hi IBM released a new update for IBM Verse in June 2017 - here is a link to "what's new". There is a new feature for Android about: Verse for Android: Certificate-based authentication However I don't think the way it works is correct. See my story below... Accordingly to documentation there are three authentication options supported by IBM Verse on Android devices: Traditional username/passwordCertificate-only authenticationCertificate and username/passwordOne of my customers had a foll
5
The application requires com.ibm.xsp.extlibx.library. This library cannot be found.
Wed, May 24th 2017 5:26p   Yuriy Pastovenskyy
Hi I want to share one strange thing that happened to me today. I have reinstalled IBM Notes 9.01 but did it a bit unusually: 1) I uninstalled IBM Notes and cleaned up all files and folders which usually stay after uninstallation. 2) Then I installed IBM Notes 9.01 and FP7 but when I wanted to install Extension Library from openntf.org I realized that I forgot to enable Domino Designer and Domino Administrator options during setup. So I run installer again, chose option "Modify", enabled Do
5
Great news about BM Notes/Domino 9.0.1 Feature Pack 8
Fri, Jan 27th 2017 3:22p   Yuriy Pastovenskyy
Notes/Domino Fix List (Copied from here) IBM Notes/Domino 9.0.1 Feature Pack 8 Preliminary Release Notice January 27, 2017 Beginning with 9.0.1 FP8, fix packs have been renamed to feature packs. To ensure quality, these feature packs still have a high focus on addressing high impacting defects. Where possible, these features are optional enabled to minimize risk. The same packaging, architecture and install kits used in previous fix packs remain in use for feature packs. IBM has identified im
16
How to set Workspace as default homepage in IBM Notes client
Wed, Oct 26th 2016 11:22a   Yuriy Pastovenskyy
Hi Recently I've got the task to set up Workspace as default homepage in IBM Notes client for about 400 users. Googling didn't really help - suggestion from IBM I found looked crazy and I didn't want to mess with it. My hope on Domino policies didn't work either - not sure, may be I missed something. However I found another interesting thing that can be very helpful for resolving this task. Database Bookmark.nsf (where Workspace is actually located) contains form "WPDiscoverChange" wi




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition