Showing posts with label lotus notes. Show all posts
Showing posts with label lotus notes. Show all posts

Thursday, February 14, 2013

Writing to log.nsf via Formula, LotusScript or Java

While debugging @Formula code I was using a lot of @StatusBar command to output values in status bar to debug. But the status bar in Lotus Notes shows only around 20-30 last entries. I was looking for a way to write that information to my local log.nsf where I could see the entire trace and analyse it. That's when I ran into this post on Notes/Domino 8.5 forum. It says that by adding LogStatusBar=1 to your notes.ini all the messages that get printed to status bar will be written to log.nsf. And problem solved!

As this method writes every message printed in status bar to log, it works for any language running on client.

Wednesday, November 21, 2012

Adding caption to image in form

When you add an image on to your form in Lotus Notes you can specify a caption for that image. In the image properties you will find this option along with where do you want to position this caption.


I usually use this technique to put text on fancy button images. So with just one image resource I can have multiple buttons with each having different text on it. You can even change the font by clicking on the image and then setting font properties in toolbar.



Some limitations of this technique are that the caption cannot be computed and it does not work on web.

Saturday, October 6, 2012

Error of "Invalid field name" while saving form

While working on a legacy Lotus Notes client based application, I did some modifications on a form but while trying to save it I was getting error message "Invalid field name" and the form simply refused to be saved. I checked all the field names trying to find out any invalid character amongst them, but no luck.

So I went to my faithful old friend — Google. And it took me to this discussion on Notes/Domino 8.5 Forum where a user was having the same issue. He resolved it by removing and adding existing sections. Why it happened, he didn't know.

Saturday, August 25, 2012

Get all field values in a document

Sometimes for debugging I am required to check all the field values in a document. It can get tiresome (and boring). So for this purpose I had created a small formula code snippet that would loop through all the fields in a document, get its values and put it in an email to the current user. I simply put this in a toolbar button of my Notes client and its good to go. Here's the code:

Tuesday, June 19, 2012

Editable authors field will auto-populate with current user's name

While working on a Notes client based application, I came across an interesting scenario. Let's say you have an editable Authors field on your form. If you open that form in Lotus Notes client then the current user name automatically appears in the field. But if you put in the field's name itself in the Default value formula then the field appears blank. My tests concluded that, this behavior is shown only by Authors field and not Readers field. Plus, I couldn't find this behavior documented in the help documentation.

Tuesday, April 17, 2012

Grappling with "Ignoring portion of document that uses a feature from another version of Notes"

In one our databases, whenever we were trying to open a document it used to give us an error of "Ignoring portion of document that uses a feature from another version of Notes". We were able to see all the fields in document properties, even able to extract all the attachments in it using LotusScript code. But document was simply refusing to open in the UI.

A little search and we found this technote which details out the reason and possible solutions to get the document opened. One of them included deleting the problematic rich text field. YIKES!

But what eventually what helped us was this intelligent suggestion by Cathy Fitzherbert. Just open the document in a browser in edit mode and save it. Then you can successfully open it in your Lotus Notes client. On the downside, you lose all the formatting in your rich text field and all the attachments will start to appear at the bottom of the document.

Wednesday, April 11, 2012

Use replica ID in @DbLookup with caution

Few days back I was faced with an issue where a user reported the following error message while opening a form in Lotus Notes client:

Field '<FIELD NAME>': Connection denied. The server you connected to has a different name from the one requested.

While this thing was working at almost all other machines (including mine), it was just one user where it was not working. The formula on the field was a single line database lookup as:


After unsuccessfully going over technotes, forums and blogs I went back to help documentation for @DbLookup and something caught my attention.

Monday, April 9, 2012

Installing and running XPages Extension Library in your local machine

I had been hearing a lot about XPages Extension Library and finally got to try it out in XPages code-a-thon held at Mumbai. So I decided to try it on my local machine along with little help from experts on StackOverflow. Its a simple two-step procedure - install extension library and run extension library.

Install XPages Extension Library

First of all get the latest release of extension library from OpenNTF. Unzip the file and find "updateSiteOpenNTF-designer.zip". Unzip it and you will get two folders of "features" & "plugins" and a file "site.xml". In Lotus Notes sidebar, go to My Widgets and select "Options > Configure a Widget from... > Features and Plugin on an Update Site". If you are unable to see My Widgets in your sidebar then click here.


Saturday, April 7, 2012

Enable "File > Application > Install..." in Lotus Notes

Mary Beth Raven in her blog here shows how to enable "File > Application > Install..." in Lotus Notes. Just you go to "<Lotus Notes folder>\framework\rcp", find a file "plugin_customization.ini" and add a line com.ibm.notes.branding/enable.update.ui=true in the file.


But based the screenshot provided on her blog I guess she didn't ran into a specific problem, which I did, because she was using Windows XP. Basically if you edit the file plugin_customization.ini and try to save it you will get an error saying "Cannot create the C:\Program Files\IBM\Lotus\Notes\framework\rcp\plugin_customization.ini. Make sure that the path name are correct."

Displaying My Widgets in your sidebar in Lotus Notes

To display My Widgets in your sidebar panel, go to "File > Preferences...". In the Widgets tab enable the option of "Show Widget Toolbar and the My Widget panel".


Tuesday, March 20, 2012

Export Lotus Notes documents to Microsoft Word

For a requirement I was looking for exporting Lotus Notes documents to Microsoft Word. I found some help here and here. The former one uses Word.Application while the latter does something with user32.dll. But I was looking for something which was not dependent on external software. Then I came across @Command([FileExport]). A little help from the discussion here, I was able to devise a simple solution to it.

Lets say, you have a form fUserProfile that you want to export to a Word file. First create a copy of that form and name it, say, fUserProfile_Export. In PostOpen event of the fUserProfile_Export form enter the following formula.


Friday, February 3, 2012

Never update agent properties using web helper agents

Well... had a hard day today. But I have only myself to blame.

We had 100+ databases which were recently moved to a new server. So we had to update the "Run on" property of the agent to the new server. That can't be difficult! Just write a helper agent that will update all those agents using the ServerName property of NotesAgent class. I did just that, made it a little bit generic by adding configurable parameters. As their were a lot of databases to be updated I decided to run this agent on the server using the OpenAgent URL command. BIG MISTAKE!

Tuesday, January 31, 2012

Disable encryption while creating new databases

My friend was facing a problem that while creating new databases in the New Application dialog the encryption settings were being set to "Locally encrypt this database using Medium Encryption".

Wednesday, January 4, 2012

Double exclamation / bang (!!) in Lotus Notes

Double bang or double exclamation (!!) is an interesting thing in Lotus Notes. It basically is an internal network separator to Notes1 used to separate the server name and database path. No wonder in older release of Lotus Notes, launching attachments which have double exclamation marks in file name would crash Notes client. Also if you try to attach a file (either from Notes client, web or XPages) with double exclamation marks in its name, then the part preceding the double exclamation marks is removed from the attached file name. So if your name of file is file!!name.txt then after attaching, your file name would be name.txt. Even using the EmbedObject method in NotesRichTextItem class attaches the file in same way.

I used it myself when I wanted to open a specific frameset in a different database. Basically where ever you find the @ button in properties, there you can specify the server & database concatenated with double exclamation marks.


Also you use it in Show Database command at the Domino server console to display database and view information on a different server. David Leedy found out that while binding XPages to external databases you need to use double exclamation. Even in the C API function of W32_NSFDbOpen(dbpath$, hdb&) you specify the dbpath$ as <Server>!!<Database path>.

Update 8 Jan 2012: Starting with Notes and Domino 8.5.3 you can set up Domino to preload XPage applications using the notes.ini entry of XPagesPreloadDB, where you specify the server and database name concatenated with double exclamation. And yes, it is present in the final release of the 8.5.3.


1. Lotus Notes and Domino 5.0.5 Release Notes (Pg 116)

Saturday, December 31, 2011

Import image resources via LotusScript & Java

People have created various versions where you can import image resources in a NSF database using LotusScript. Basically you mimic the functionality of "Import Image Resource" button present in Domino Designer via code.


Some of the examples can be found here and here. Here is my version of doing this same thing using combination of LotusSciript & Java with LS2J.

Three people icon...

Here are some three people icons similar to Lotus Notes. I will be updating it as when I come across new logos... :)

Lotus Notes

MySpace

Friday, December 16, 2011

Where are the breakpoints stored?

I am sure at some point or another you would have used breakpoints while debugging your LotusScript code. But I always wondered how does Lotus Notes store them. Well, it stores in the profile documents. To view the profile documents in your database there free utilities available like - NotesPeek (my favorite), ProfileMgr by Andre Guirard or NoteMan.

Using NotesPeek you can see a profile document named "breakpoints_" which stores all the breakpoints.


Sunday, December 11, 2011

Creating ticker using JavaScript inside Lotus Notes client

I always felt that the power of JavaScript is Lotus Notes client is underrated. Some articles which do describe this are here and here. I realized this power when a some time back I had create a ticker that worked in Lotus Notes client. You can simply embed an Java applet in the form but, Java applet and Lotus Notes don't gel together very well. You also go for animated table, but then you there would be only specified number of entries (rows) which you be able to cycle through.

Using JavaScript to create a ticker is very similar to creating one for Web browser. To start off create two computed fields on your form - TickerURL & TickerText with their respective field names in their value.


Put an action hotspot around the field TickerText and write the following formula:

Editable field which does not get saved in document when saved


Ever wondered whether an editable field can be created on a form which does not get saved when the document is saved! Well it can be done. It’s pretty simple. All you need to do is to write @DeleteField in the "Input Translation" formula of the editable field in the form.


You can have an elaborate formula written in Input Translation based on which you can decide whether to save the field in document or not.