Hi, I am trying to use formula language to retrieve comma separated list of names for a Domino user. However, the returned vector contains only one name i.e.instead of fetching the entire list, only the first element of the list is being returned. Please tell me where am I wrong?
Here’s the piece of code :
Vector fullNames = Session.evaluate(“@NameLookup([Exhaustive];"”+ userName + “"; "FullName")”);
userName is a string variable.
thanks,
Zohaib
Subject: RE: @NameLookup not returning complete List
Yes, that’s how @NameLookup works. Only a single value will be returned from each matching contact document, even though the field you lookup is multivalued. Where the Designer help talks about it returning “all information” for the matching users, it really means that it will continue to search through all the directories until it finds all users that match the specified search name – not that it will return extra information for each user. Sorry.
Subject: RE: @NameLookup not returning complete List
Hi Andre,
Thanks for the information. But,I am stuck up in a situation where i need to fetch all the names from the multivalued field of the person document. Previously,I was using this piece of code :
DocumentCollection dc = dbnames.search(“(FullName="” + userName + “")& (Form="Person")”);
for each document in the docCollection dc,
{
Vector vFullName = doc.getItemValue(FULL_NAME);
}
this vector would contain the multiple values. However, this procedure takes approx. 3 seconds for each person document, a very time consuming process.Therefore ,I tried using @NameLookUp, which isn’t helping either,(a faster process but unable to retrieve all the values).
Can you suggest some other ways to fetch the multiple attributes of a field in any person/group document?
thanks,
Zohaib
Subject: RE: @NameLookup not returning complete List
All NameLookup really does is look up the name in the ($Users) view, I believe. You can probably get good performance if you use GetView to get that view, then do a key search in the view (GetDocumentByKey for instance).
Alternately, you could issue a single query that asks for all the users at once, but the view lookup is probably faster. Just make sure you only get the view once, then do all your lookups – not once each time through the loop.