Xpage and Dblookup

Hi,I am working on creating an Xpages with multiple combo boxes. The user picks a name from the first and the second performs a Dblookup on that name and provides a matching phone number. This works fine when the user has only one phone. However if there are multiple matches on one is being sent to the list. Below is my code. Can you tell my what I am doing wrong or what I can do?

try{

db = session.getDatabase(“”,“TeleRecord2.nsf”);

var user = getComponent(“user1”).getValue();

var list = @DbLookup(db,“(Userviewflat)”, user, 3);

if (@IsError(list))

return “Please select a user first|”;

else

return list;

}catch (e){

return “Please select a user first (Error)|”;

}

Subject: Did you see what list returns when it has more than one value?

I think it might return a vector when you have more than one match. I am not sure where your code? But, you probably have to deal with the case where the returned value is not a string.

Just put your code in a computed value control and see what happens…

Howard

Subject: Xpage and Dblookup

Hi,The combobox is a computed value field. The User combobox partially refreshes this field and the lookup is done. However if there are two matches I see only the first.

Subject: Xpage and Dblookup

Hi,This formula works in standard notes and returns two phone numbers.

@DbLookup(“”;“852577B9:005F8E4B”;“(Userviewflat)”;User;3)

but in Javascript in the Xpage using

db = session.getDatabase(“”,“TeleRecord2.nsf”);

var user = getComponent(“user1”).getValue();

var list = @DbLookup(db,“(Userviewflat)”, user, 3); It returns only one number. The only difference is the use of the ReplicaID vs the DB name.

Any ideas?