Solved

Profile Doc Field Names problem

Posted on 2004-08-19
8
342 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 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
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 11843415
try this

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


~Hemanth
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now