The content that I am trying to describe on this particular post is fairly simple. Many of you guys out there would have faced it and solved it. But still I would like to share this cos, really XPages are stupid at times.
I had the formula session.getCommonUserName() on a lable which worked for me through out the period I was developing my last application. When I moved the same to a test server to test the same, to my astonishment I found that the label with the above mentioned code displaying my test server's name.
I opened up the XPage in designer, saved it manually,
Signed the database using server id,
compacted the database ,
Restarted my test server etc etc...
All of the above steps failed and it still kept displaying my server name
Later I changed the code to @Name("[CN]",@UserName()), the formula eqivalent in server script.
OOPS that failed tooo...
And after a few brief moments of frustrations, I got the following idea,
And that eventually saved me.
Feels strange aaha...
Hope this helps :)