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?

Thursday, September 6, 2012

Expand / Collapse particular category in a view in XPages

In XPages, you can expand all / collapse all categories in a view either using the expandLevel property of view control or using view control API. The API technique can further be extended to expand / collapse a particular category in a view. So to expand the code goes like this:

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.

Monday, July 30, 2012

Using extension library component Remote Service

Recently I had some queries on using the extension library component of Remote Service a.k.a. <xe:jsonRpcService>. I posed this question on StackOverflow and Tim Tripcony gave a detailed answer along with some operations where this might be useful. I would strongly suggest going through Tim's answer.

Friday, July 27, 2012

Creating optgroup tag in combo boxes in XPage

Tommy Valand in his blog post pointed to a StackOverflow question to add <optgroup> in combo box in JSF. Using hints from there I was able to devise a way to get <optgroup> in combo box for XPages. Below is the code snippet for the combo box.

Wednesday, July 25, 2012

Getting stack trace of error in LotusScript

Java has a wonderful method called printStackTrace which prints out the entire stack trace in case of exception. Unfortunately LotusScript does not have any similar functionality. But we can use On Error statement to reproduce this functionality.