Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

Sign in to participate Previous Next

Several things

1. Your code is opening a view called "(ShortName)" in names.nsf. That is not a standard view name in the template supplied by IBM. Did you create it in your Domino Directory? Is the first column sorted? Does the value in that column match your 'EmpCode' variable? Note: If you did add this view, you may not really need it. You could be using $Users, which includes the ShortName in the first sorted column, along with other values. The only reason you might not want to use $Users is if you need to be sure that the code values are definitely coming from the ShortName item in order to avoid potential conflicts. Of course, you could use $Users and also do an explicit doc.getItemValues("ShortName") and then double-check the (0)th entry for a match, and that would save you from having to maintain an extra view.

2. After your call to getDocumentByKey, you should be doing something like if doc is Nothing then... Relying on 'on error' is bad practice when you can avoid it. This is not causing your problem here, but it may be hiding it. You should always do explicit error checks whenever possible, because it makes your code much easier to debug. (Please note that I'm not saying you should never use 'on error'. In fact, you should almost always use it to handle problems that are truly unexpected, but not things like documents or items that are not found.)

3. And you should also be doing an explicit check of if doc.hasItem("DisplayName") before you do the doc.getItemValue("DisplayName"). In fact, in the standard names.nsf there is no item called DisplayName in Person documents, so my guess is that this is your problem -- or part of it -- and the 'on error' is hiding it from you. Yes, there is a field called 'DisplayName' in the Person form, but it is computed-for-display so the field is never stored as an item. You should probably be using FullName instead of DisplayName, since that's how the computed-for-display field formula for DisplayName gets its value.

I'd say it's even money on either #1 or #3 being your problem, but you should fix all three issues.


Feedback response number WEBB8W4RYS created by Rich Schwartz on 07/11/2012

Error in code (Meena Ramesh 11.Jul.12)
. . Several things (Rich Schwartz 11.Jul.12)
. . . . Conclusion (Meena Ramesh 12.Jul.12)
. . . . . . The code still got a number of issu... (Karl-Henry Mart... 12.Jul.12)
. . . . I'd click "Like" on this response i... (Phil M Jones 12.Jul.12)
. . Data Types (Pete Burn 11.Jul.12)
. . . . Reply (Meena Ramesh 11.Jul.12)
. . . . . . Try this... (Karl-Henry Mart... 12.Jul.12)
. . . . . . 1 character missing (Phil M Jones 11.Jul.12)
. . . . . . . . Stll problem persists (Meena Ramesh 11.Jul.12)
. . . . . . . . . . Have you tried the debugger? (Phil M Jones 11.Jul.12)




Printer-friendly

Search this forum


Sign In or Register

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support


 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow