bobdraz
asked on
Profile Doc Field Names problem
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("Pro fileDoc")
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
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("Pro
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops, I think it is getItemValue, not getItemValues
ASKER
I get a Type Mismatch on the following:
If prfdoc.getItemValue(fldnam eApprv) <> "" 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.
If prfdoc.getItemValue(fldnam
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.
try this
If prfdoc.getItemValue(fldnam eApprv)(0) <> "" Then
~Hemanth
If prfdoc.getItemValue(fldnam
~Hemanth
ASKER
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(fldnam eApprv)(0) <> "" Then
getProfile = prfdoc.getItemValue(fldnam eApprv)
Else
If prfdoc.getItemValue(fldnam eBkupApprv )(0)<> "" Then
getProfile = prfdoc.getItemValue(fldnam eBkupApprv )
Else
If prfdoc.getItemValue(fldnam eDoer)(0) <> "" Then
getProfile = prfdoc.getItemValue(fldnam eDoer)
End If
End If
End If
If prfdoc.getItemValue(fldnam
getProfile = prfdoc.getItemValue(fldnam
Else
If prfdoc.getItemValue(fldnam
getProfile = prfdoc.getItemValue(fldnam
Else
If prfdoc.getItemValue(fldnam
getProfile = prfdoc.getItemValue(fldnam
End If
End If
End If
ASKER
I should mention that prfdoc.getItemValue(fldnam eApprv)(0) returns the field name and not the field contents.
ASKER
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...
Sorry I didn't respond back here... I did respond in your new question.