Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Profile Doc Field Names problem

Posted on 2004-08-19
8
Medium Priority
?
354 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
  • 4
  • 3
8 Comments
 
LVL 31

Accepted Solution

by:
qwaletee earned 2000 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

886 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