This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 8, 2011, 11:45 AM
2 Posts

Profile docs and XPages

  • Category: Server Side JavaScript
  • Platform: Not Applicable
  • Release: 8.5.2
  • Role: Developer
  • Tags: Profile docs,Document source
  • Replies: 1
I am able to use a profile document as a source for my XPage by setting the data source of my XPage to look for a specific document id in Open document and by not specifying a form there.
 
I can then access this source from fields using: 
 

var _list = langprofile.getValue("profilefieldname");

var _array = new Array (_list);

if(_list == null){

return "no values"

}

else {

return _array[2]

}

 
But at the moment I am using a fixed hard coded document id and our systems have hundreds of profile documents so I need to be able to calculate these dynamically.
 I notice it is possible to compute a document id in this place but am wondering how to do this.
 
Can I use @GetProfileField for example or @SetProfileField for example to get a handle on a specific profile document and then somehow get the ID. Or if I can use these can I simply compte the name format and then look for the profile doc with that name from my field searches without specifying a docment source and perhaps using these Notes formulas to get my result?
 
Any thoughts? 

Apr 13, 2011, 12:17 PM
122 Posts
Re: Profile docs and XPages
I've had problems with profile documents and caching. I've heard of other people encountering the same kinds of issues. My preferred method now is to create a document with a programmatically manipulated the Notes Document UNID, following this tip from Chris Toohey.
 
You can programmatically get your 'profile document' ID into an applicationScope variable using
session.evaluate("@Text(@Password(|"convertThisString\"))") 
Then you can check whether the document exists in the database and, if it doesn't, create it. You can then point the documentId attribute to the applicationScope variable where you save the 'profile document' ID. It's (almost) infinitely scalable and more predictable in its results than a profile document.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal