I just want to remove CN= from CN=Jeremy/US/America…how do it do it in lotus script
Subject: remove CN= how
The canonical value is “CN=User Name/OU=Department/O=Company”. You can create a NotesName object from that string, then get the Abbreviated property to get “User Name/Department/Company”.
Subject: RE: remove CN= how
thanks…i got the correct sring now
Dim nabuser As String
Dim nname As NotesName
Set nname=session.createName(session.username)
Messagebox nname.Abbreviated
Set nab=session.GetDatabase(“Hub01”,“names.nsf”)
Set nabview=nab.GetView(“$VIMPeople”)
Set nabdoc=nabview.GetDocumentByKey(nname)
Messagebox nabdoc.Department(0)
I get the error variant does not contain an object. what have i done incorrectly?
I just want to get the Department and Manager from the domino directory
Subject: RE: remove CN= how
I’m guessing (FYI, it helps if an error occurs to tell us where) the line you’re getting the error on:
Set nabdoc=nabview.GetDocumentByKey(nname)
Here is how I would approach the problem. (This is meant as advice to help you in the future)
nname is a NotesName.
The Help states for method GetDocumentByKey:
keyArray parameter
String (variable-length only), integer, long, single or double value, or array of string, number, DateTime, or DateRange objects.
Therefore, the keyarray paramter cannot be a notesname value. We need to make it a string. Looking at the NotesName properties there are lots of choices. So I would change the line to:
Set nabdoc=nabview.GetDocumentByKey(nname.abbreviated)
Hope that solves the error and helps.
Subject: RE: remove CN= how
thank you…nname.abbreviated seems to fix my issue.
Subject: Use @Name([Abbreviate];@Username)
See here for details:
Alan Lepofsky - IBM/Lotus
Learn more at my Lotus Notes Tips and Tricks Blog
LOTs of US working together to innovate for success
Subject: remove CN= how
Look in the Designer help for the NotesName Class
JYR