Access profile data (and cache them)

Access profile data (and cache them)

The following code assumes that you have created a profile document with the form name “fmProfile”.
The function getProfileField returns a Vector, so if you want to access only one value, use getProfileField(“fieldname”)[0] . The function uses also OpenLog in case of an error, so if you don’t use OpenLog, just comment that line out.
function getProfileField(sFieldName){

vResult = null

try{
var profile:NotesDocument = null

if (applicationScope.profile == null){
profile = database.getProfileDocument("fmProfile", "")
}else{
profile = applicationScope.profile
}

vResult = profile.getItemValue(sFieldName)

}catch(e){
log.logError( e.toString(), null, e );
return e.toString()
}

return vResult
}

Leave a Reply

comment-avatar

*