193 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Great news about BM Notes/Domino 9.0.1 Feature Pack 8
Fri, Jan 27th 2017 10
How to set Workspace as default homepage in IBM Notes client
Wed, Oct 26th 2016 9
Avoid processing items as both NotesItem and NotesMIMEEntity objects concurrently.
Thu, Jul 21st 2016 8
Third level in "Application links" section of Xpages Application Layout, WTF?
Sat, Jul 16th 2016 9
How to get a list of components for not open Xpage ?
Thu, Mar 24th 2016 10
LDAP on Domino with iPhone (iOS8x) - can it work?
Mon, Sep 14th 2015 10
A question: do you know how to disable/remove/cleanup Xpages tooltips in Domino Designer? They make me crazy.
Fri, Sep 11th 2015 9
Top 10
No such session or session has been closed
Sun, Nov 2nd 2014 18
Corrupted unread list in Mail database caused "This database cannot be read due to an invalid on disk structure"
Thu, Jul 17th 2014 16
If you can't remove lotus notes database icon from workspace
Wed, Sep 10th 2014 13
Wrong name of attached file in inbound email: "=?UTF8?Q?=....
Tue, Apr 15th 2014 12
NotesItem.Type = 256 causes "Variant does not contain a container"
Sat, Jul 26th 2014 10
LDAP on Domino with iPhone (iOS8x) - can it work?
Mon, Sep 14th 2015 10
How to get a list of components for not open Xpage ?
Thu, Mar 24th 2016 10
Great news about BM Notes/Domino 9.0.1 Feature Pack 8
Fri, Jan 27th 2017 10
IBM Lotus Notes and Ctrl+Break on new laptops without button "Pause/Break" on keyboard. Is it familiar to you? :-)
Thu, May 29th 2014 9
A question: do you know how to disable/remove/cleanup Xpages tooltips in Domino Designer? They make me crazy.
Fri, Sep 11th 2015 9


NotesAgent.Runwithdocumentcontext() - cool thing
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
   

Hi guys

I would like to draw your attention to method Runwithdocumentcontext() of NotesAgent class.

I personally missed this method somehow and found out about it just recently though it was released with IBM Lotus Notes 8.5.2.

It finally allows developers to pass a non-saved NotesDocument to a NotesAgent. Let me explain.

I believe all of you had a task where you needed to pass many constants/parameters/fields to a NotesAgent to let the agent to do some work. Earlier (prior LN 8.5.2) we had only two methods for that:

  • NotesAgent.Run(noteid)
  • NotesAgent.RunOnServer(noteid).

Notice, since these two methods work with NoteId it is required to save document to be able to pass it to NoteasAgent.

I usually created a temporary document, put required parameters there, saved document and then passed its NoteId to one of the methods mentioned above depends of what I need to rich.

However...


However, the problem of this way was that later I had to clean up after myself - I had to remove that temporary document that I didn't need any more. It wasn't so easy task though. The NotesAgent.Run() method works with a current user's privileges and document deletion can be restricted. The same about NotesAgent.RunOnServer(noteid) in a local replica. Besides that if agent fails then temporary documents can stay in database as garbage. So, to be sure for 100% that I cleaned up everything I had to create a scheduled agent for that that is not the best option also - I personally do not like if database contains many scheduled agents, especially if you use some common template for tens of similar applications. Plus all these things about Server Security - sometimes (if you work for big companies with complex internal policies) it is a tricky thing to get permission to create any scheduled agents, you know :-)

But now, with this nice method NotesAgent.Runwithdocumentcontext(documentcontext as notesdocument, optional byval noteid as string) you can pass any number of parameters to a NotesAgent through a temporary document without need to save it and later delete.



---------------------
http://ypastov.blogspot.com/2014/05/notesagentrunwithdocumentcontext-cool.html
May 29, 2014
8 hits



Recent Blog Posts
10
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
9
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
8
Avoid processing items as both NotesItem and NotesMIMEEntity objects concurrently.
Thu, Jul 21st 2016 4:46a   Yuriy Pastovenskyy
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
9
Third level in "Application links" section of Xpages Application Layout, WTF?
Sat, Jul 16th 2016 12:51p   Yuriy Pastovenskyy
Hi Do you know how to create a third level in "Application links" section of Xpages "Application Layout" control? It has to work but it doesn't. Please look on my screen shots below. Here is a simple page with a single "Application layout" control (Bootstrap theme). I have added three levels for my top menu (in different ways). However in browser I only can see two first levels and whatever I tried to do the third level never appear. Do you know how to fix that? P.S.I have the lates




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