Archives for the ‘@Formula’ Category

25 Oct 2011

XPages Tip: @Dblookup() and Javascript Array

I learned a valuable lesson yesterday. I declared a Javascript variable called myarray and wanted to assign a list generated from a DbLookup. The good news is that this works 99%. There is just 1 small exception. If the DbLookup only returns 1 value, it then passes that value as a string and not an array, even if you force it to be an array. See below example of how to get around this.

// Initiate the DB Lookup and pass it to the JS Variable

var mydb = new Array(database.getServer(),database.getFilePath());

var myarray = @DbLookup(mydb, “ViewAliasName”, “key”, 2);

// Make sure a value was returned, then make sure it’s an array   

if(myarray == undefined)


return false;


else if(myarray[0] == undefined)


var myarray = new Array( myarray );


24 Oct 2011

Lotus Notes Tip: Error Document Has Not Yet Being Saved

   If you’ve ever come across a Lotus Notes Error, where you click on a button in an Open Document which is in Edit Mode, where the Formula behind the button is an @Command( [RunAgent] ; “AgentName” ), and you receive an error “Document Has Not Yet Being Saved“, a most likely solution will be to set the “Target” parameter on the NotesAgent to “None“. Lotus does not like the target been set to “All Selected Documents”.

Unless I’m mistaken, you would not need the Target to be set to anything else in this particular scenario.