Regarding changing of Certifier name

Dear all

I have a field called manager with type as “Names” and choices as “Use Address Dialog for Choices”.

Say manager is “Domino” then on selecting the manager this field would display value as “Domino/CSO/USA/XXX”.

I have an agent. This agent will prompt the value in the Manager field.

my problem is while getting the value like “CN=Domino/OU=CSO/OU=USA/O=XXX” from the field Manager insted of getting the value “Domino/CSO/USA/XXX”.

Please advise me on this. I need exact word as it is in the field Manager.

my code is


Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim LCView As NotesView

Dim CertifierName As String

Dim item1, item2 As NotesItem

Dim strArg As String

Set db = session.CurrentDatabase

Set LCView = db.getview(“MyView”)

Set doc = LCView.GetFirstDocument

While Not (doc Is Nothing)

            Set item1 = doc.GetFirstItem("namManager")	CertifierName = item1.text

Msgbox CertifierName

Set doc = LCView.GetNextDocument(doc)

Wend


How to overcome this. I want the exact string as it is in the field Manager.

Subject: Regarding changing of Certifier name

Using Cannonical Property in the NotesName class, we can get the cannonical name as the output

But in your case you should use Abbreviated Property in the NotesName class

Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim LCView As NotesView

Dim CertifierName As String

Dim item1, item2 As NotesItem

Dim strArg As String

Dim nam As NotesName



Set db = session.CurrentDatabase



Set LCView = db.getview("MyView")

Set doc = LCView.GetFirstDocument



While Not (doc Is Nothing)

                          ' doc.namManager(0) -- gives the values in the "namManager" field in the current document context



	Set nam = session.CreateName(doc.namManager(0))   		CertifierName = nam.Abbreviated

	

	Msgbox CertifierName

	

	Set doc = LCView.GetNextDocument(doc)

	

'	Set item1 = doc.GetFirstItem("namManager") 

'	CertifierName = item1.text

'	Msgbox CertifierName

'	Set doc = LCView.GetNextDocument(doc)

	

Wend

– Lakshmi

Subject: Regarding changing of Certifier name

Prasad

A names type field always stores the name in a canonical format even though it might show it to you in an abbreviated format.

So you can easily get the abbreviated name by using the Abbreviated property of the Notesname class.

HTH

A

Subject: RE: Regarding changing of Certifier name

Thanks to Lakshmi and Khalid.It worked. Thanks and cheers :slight_smile: