Solved

Profile Doc Field Names problem

Posted on 2004-08-19
8
350 Views
Last Modified: 2013-12-18
I'm having trouble reading 3 fields on a Profile document. The three variables

                Dim fldnameApprv As String
      Dim fldnameBkupApprv As String
      Dim fldnameDoer As String

are populating with the correct field names being passed from another function:

                fldnameApprv = "fldPrflAppvr" +  (stName)
      fldnameBkupApprv = "fldPrflBkupAppv" + (stName)
      fldnameDoer = "fldPrflDoer" + (stName)

How can I plug in these field names so the following lines work:


If prfdoc.fldnameApprv <> "" Then
      getProfile = prfdoc.fldnameApprv + (stName)
Else
      If prfdoc.fldnameBkupApprv + (stName) <> "" Then
            getProfile = prfdoc.fldnameBkupApprv + (stName)
      Else
           If prfdoc.fldnameDoer + (stName) <> "" Then
            getProfile = prfdoc.fldnameDoer + (stName)


Here's the whole function code.

Function getProfile (stName) As String
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim prfdoc As NotesDocument
      Dim fldnameApprv As String
      Dim fldnameBkupApprv As String
      Dim fldnameDoer As String
      Set db = session.CurrentDatabase
      Set prfdoc = db.GetProfileDocument("ProfileDoc")
      fldnameApprv = "fldPrflAppvr" +  (stName)
      fldnameBkupApprv = "fldPrflBkupAppv" + (stName)
      fldnameDoer = "fldPrflDoer" + (stName)
      If prfdoc.fldnameApprv <> "" Then
            getProfile = prfdoc.fldnameApprv + (stName)
      Else
            If prfdoc.fldnameBkupApprv + (stName) <> "" Then
                  getProfile = prfdoc.fldnameBkupApprv + (stName)
            Else
                  If prfdoc.fldnameDoer + (stName) <> "" Then
                        getProfile = prfdoc.fldnameDoer + (stName)
                  End If
            End If
      End If      
      
End Function
0
Comment
Question by:bobdraz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 31

Accepted Solution

by:
qwaletee earned 500 total points
ID: 11843223
prfdoc.getItemValues(fldnameApprv)

Which will return an array, so you may want to use: prfdoc.getItemValues(fldnameApprv)(0) = ""
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11843237
Oops, I think it is getItemValue, not getItemValues
0
 

Author Comment

by:bobdraz
ID: 11843360
I get a Type Mismatch on the following:

If prfdoc.getItemValue(fldnameApprv) <> "" Then

The end result I looking for is the contents of the field. Of the three fields, the first that isn't equal to spaces is the value I want to pass back from this function.
      
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 11843415
try this

If prfdoc.getItemValue(fldnameApprv)(0) <> "" Then


~Hemanth
0
 

Author Comment

by:bobdraz
ID: 11843581
That got me past the Mismatch Type, but it doesn't seem to recognize that the first field is not equal to spaces. There is text data ("AS") in the first field.

If prfdoc.getItemValue(fldnameApprv)(0)<> "" Then
      getProfile = prfdoc.getItemValue(fldnameApprv)
Else
      If prfdoc.getItemValue(fldnameBkupApprv)(0)<> "" Then
            getProfile = prfdoc.getItemValue(fldnameBkupApprv)
      Else
            If prfdoc.getItemValue(fldnameDoer)(0) <> "" Then
                  getProfile = prfdoc.getItemValue(fldnameDoer)
            End If
      End If
End If      
      
0
 

Author Comment

by:bobdraz
ID: 11843633
I should mention that prfdoc.getItemValue(fldnameApprv)(0) returns the field name and not the field contents.
0
 

Author Comment

by:bobdraz
ID: 11843660
Just to mention, I'm passing the field name I want the content of to this function. I need to plug in that field name and get the contents from the profile doc in this fuction. What I get is the field name itself. - Help...
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11855115
Sorry I didn't respond back here... I did respond in your new question.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I delete a user in IBM Lotus Notes 2 214
Switching from Lotus Notes to Outlook 4 71
Inconsistent date field in Lotus Notes 6 102
IBM Lotus Notes Rules not working 5 357
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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