@nameslookup function in R5

I need to access a field called Department from the Notes Name & Address book and display it in a form.  It should display the corresponding dept. of the requester name from the NAB. I use the new function for R5 @NamesLookup and able to get the result but in a different way.  I tried all available options without luck, If I use the [EXHAUSTIVE] option, It first looks at my Local names.nsf and then goes to the Server's Names.nsf if I have a value in the field Dept. in both the places, it pulls in both the values which I don't want.  I require only the Dept. name value from the Server's names.nsf... Did anyone encounter this and any solutions are gladly welcome.  Is there anyother easy way to get this !!!

Thanks,
Ganesh.
ganuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ghassan99Commented:
From the Notes help:
[NOSEARCHING]  Searches only the first NAB containing the "($Users)" view, and returns a list of single text values for each specified username. An empty string is returned for no match found. Corresponds to NAME_LOOKUP_NOSEARCHING flag for Notes API.
[EXHAUSTIVE]  Searches all NABs listed in NAMES variable in notes.ini and returns all information in a text list. The user's value is omitted if there is no match found.

If this was to run on the server, it will usually have one NAB in the 'names=' attribute in notes.ini and especially in R5, where its most certainly one value.  So the [EXHAUSTIVE] option will work since it will search only one address book.  Its natural to return several values for the same name if it was found in more than one address book.  The [NOSEARCHING] flag should work for you though.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ganuAuthor Commented:
HI.
 This is to run from all the workstations too and so it looks in the Local Names.nsf and picks up the name first If I use the [Exhaustive] Option. I tried using [NoSearching] too but it returns a blank only.   Pls. explain.
Thanks.
Ganu
0
ghassan99Commented:
Yes sorry, it will look in the local names.nsf first.  Even [NoSearching] will return the first existense in the local address book.  According to the help,  it will look in the first names.nsf that contains ($users) view, which will normally be the local one.  Exhaustive will search the NABs in the notes ini, "names=" attribute.  And again the first will be the local.  So it will allways look in the local, it will return the value in the server only if it cant find it on local. What I suggest is to use the list functions to manipulate the list of values returned per user searched.  Or when I think about it, why not use @dblookup? eg:
@Prompt([OK];"test";@dblookup("":"";"server_name":"names.nsf";"($users)";"smallcase_lastname_of_user_to_search";"field_name_to_retrieve"))
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

ghassan99Commented:
by the way, if [nosearching] is not working for u, I assume then that the first address book that is looking in, doesnt have the value ur searching for, thats why its returning blank.
0
ganuAuthor Commented:
Yeah,
 I deliberatley removed the value in the dept. field from the local address book just to make sure it returns only one value.  IT's fine with me but I cannot do it for all the 250 users.. I have thought of using @unique with the @Namelookup function to see if it works. I can use @Dblookup but I wanted to use the new function from R5.
Thanks for your help.
Bye,
Ganu.
0
ghassan99Commented:
yes @unique will work.  But its case sensitive, so minor change in the name can still produce duplicate entries.  I suggest u use @elements to know the number of items found and use @subset to extract the 2nd value for instance which will be coming from the server addressbook.
u r right its good to use the new features in R5, maybe in the new releases they will enhance the function to be able to extract values only from the server's address book, if a lot of developers required it.
0
ganuAuthor Commented:
Thanks,
I guess that should work too.  I shall give it a try.
Cheers,
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.