~Rex UmremanAug 15, 2011, 3:02 PM272 PostsRe: @DBLookup of an external database in JavascriptHi, instead of returning "Please select an acronym first (Error)" you could do return the error. Just change the line return "Please select an acronym first (Error)"; to return e and check the message. Sven
~Kim KifanalygonAug 15, 2011, 3:25 PM10 PostsRe: @DBLookup of an external database in JavascriptOk, when I did that, all I got was: Error: "e" not found. MJ
~Anita MinasteringsAug 15, 2011, 5:08 PM298 Postsneed two backslashes?var db = Array("notea02a/SERV/Srs","Apps - SystemFolders\\ NotesSystemFolders.nsf");
~Rex UmremanAug 15, 2011, 5:10 PM272 PostsRe: @DBLookup of an external database in Javascript"e" is the variable in the catch-block. If it is not found, it sounds to me that you have a syntax problem in your code.Try to rebuild the fragments of your code. Remove the code in the try{} - section. Then there should be no error anymore.
~Wei OpboosilyakoiAug 16, 2011, 11:09 AM6 PostsRe: @DBLookup of an external database in Javascript i couldn't get that to work either so i did a workaround :-) // get the data from the setup var sdoc:NotesDocument = session.getCurrentDatabase().getView('vwluSetup').getFirstDocument(); var nab_server:String = sdoc.getItemValueString('fldNABServer'); var nab_path:String = sdoc.getItemValueString('fldNABPath'); var nab_view:String = sdoc.getItemValueString('fldNABView'); //conect the external dbvar directory:NotesDatabase = session.getDatabase(nab_server, nab_path);var allUsers:NotesView = directory.getView(nab_view);var searchValue:string = 'whatever_to_search_for';var matchingEntries:NotesViewEntryCollection = allUsers.getAllEntriesByKey(searchValue, false);var entry:NotesViewEntry = matchingEntries.getFirstEntry();
~Kim KifanalygonAug 16, 2011, 12:34 PM10 PostsRe: @DBLookup of an external database in JavascriptWell, I feel pretty stupid to tell you what the problem was but here it is: var db = new Array("notea02a/SERV/Srs","Apps - SystemFolders\\NotesSystemFolders.nsf"); I forgot to put two backslashes in the file path. I found it when I had the error return the value of the db variable. Oh well, live and learn. Thanks for all the help. MJ