Monday, 28 March 2011

Getting unique results from Xpages DbLookup and DbColumn functions

After using the DbColumn and DbLookup code I posted a while back I found another thing that needed solving.
Frequently I want these functions to only return unique values. But placing @Unique around the function calls gives the empty result as before for a repeat control if the result of the function is a single value, a string in effect.
So I added a line of code and a parameter to the functions to be able to request unique values (see the code below).

DbLookup
The code has been moved and can be found here: http://notesnl.blogspot.com/2011/09/final-version-of-dblookuparray.html


DbColumn
The code has been moved and can be found here: http://notesnl.blogspot.com/2011/09/final-version-of-dblookuparray.html

No comments: