Showing posts with label formula language. Show all posts
Showing posts with label formula language. 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.

Friday, September 28, 2012

Other ways to use @DeleteField

The help documentation of @DeleteField only displays one way on its usage:


But recently while working on an application I found out that there are other ways in which this command can be used.


Would love to hear if you know any other ways to use the command?

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:

Thursday, August 23, 2012

Reading Windows registry from Lotus Notes using formula

I can't remember what exactly I was searching for when I ran into this question on N/D 8.5 forum which introduced me to the function @RegQueryValue. Basically this function allows you to read the Windows registry.

So if you want to read CPU information on a particular machine then you would write code as:


Unfortunately I couldn't find any function to write registry value.

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.

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.