Solved

Profile Doc Field Names problem

Posted on 2004-08-19
8
352 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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

623 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