?
Solved

@nameslookup function in R5

Posted on 1999-12-16
7
Medium Priority
?
590 Views
Last Modified: 2013-12-18
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.
0
Comment
Question by:ganu
  • 4
  • 3
7 Comments
 
LVL 6

Accepted Solution

by:
ghassan99 earned 200 total points
ID: 2288432
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
 

Author Comment

by:ganu
ID: 2289902
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
 
LVL 6

Expert Comment

by:ghassan99
ID: 2291907
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
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
LVL 6

Expert Comment

by:ghassan99
ID: 2291910
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
 

Author Comment

by:ganu
ID: 2292704
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
 
LVL 6

Expert Comment

by:ghassan99
ID: 2292952
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
 

Author Comment

by:ganu
ID: 2295560
Thanks,
I guess that should work too.  I shall give it a try.
Cheers,
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…
Suggested Courses

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question