Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
How to open an Xpage from the Lotus Notes Client view or form

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#OpenXpageFromClient or http://www.notesninjas.com/A555F9/nn.nsf/ByAlias/OpenXpageFromClient


I was expecting a nice easy @command([OpenXpage];"Home.xsp") or uiw.openxpage command but no there isn't one. Here is how to do it.





To open the Home.xsp Xpage into your favourite browser from the Lotus Notes Client you can use code such as:

REM "Code from http://NotesNinjas.com/#OpenXpageFromClient";

r:=@DbLookup("";@Subset(@DbName;1):"names.nsf";"($Servers)";@Subset(@DbName;1);"HTTP_HostName");

s:=@If(@IsError(r) | @Text(r)=""; @DbLookup("";@Subset(@DbName;1):"names.nsf";"($Servers)";@Subset(@DbName;1);"SMTPFullHostDomain"); r);

@URLOpen("http://"+@Text(s)+"/"+@WebDbName+"/Home.xsp";)

 

To open an Xpage in the Notes Client do this instead:

REM "Code from http://NotesNinjas.com/#OpenXpageFromClient";

@URLOpen("Notes://"; + @Name([CN]; @Subset(@DbName; 1)) + "/" + @Text(@ReplaceSubstring(@ReplicaID; ":";""))+"/Home.xsp?OpenXpage")

 

This is the lotusscript version of opening an xpage in the client, stick it in a button.

' Lotusscript version from http://NotesNinjas.com/#OpenXpageFromClient


 Dim s As New  notessession
 Dim db As notesdatabase
 Set db = s.CurrentDatabase
 Dim sname As New NotesName(db.Server)
 
 notesurl = |notes://| +  sname.common+ "/" + Cstr(db.Replicaid) + "/Home.xsp?OpenXPage"
 Dim uiw As New notesuiworkspace
 Call uiw.URLOpen(notesurl)

NB you need the ?OpenXPage bit in there for it to work

 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
Beginning Java Web Services by Andre Tost, Henry Andre Bequet, Meeraj Kunnumpurath, Sean Rhody
Web services are no longer a nascent technology in the programming industry; every major software vendor is rolling out web services-related APIs and products. Today Java developers are successfully adopting web services as the latest technology in application development in order to enable...
See at: Amazon.co.uk | Amazon.com |