2
votes

I have a Xpages app that containts Tips. I send out weekly emails with links to the documents in the database. I want to be able to compute in the document the proper URL for opening these in the web, but I cannot seem to be able to do that (I need to do this as the users might be on cellphones, at home, in iNotes, etc.

var urlStr:String = "https://xxxx.xxx.com/";
var dbStr:String = "database.nsf/" 
var UNID:String = document1.getDocument().getUniversalID();
urlStr = urlStr + dbStr + "0/" + UNID + "?OpenDocument"

This opens the document on the web, even though I have the form set to open in an page.

https://xxxx.xxx.com/database.nsf/xpage.xsp?action=openDocument&documentId=0858F9AC8B9E011C86257C05006E5315

This is the URL that I want to compute, but I cannot see how I can compute the name of the Xpage in the Xpage.

There has to be a way.

Trying to access the form element

Sub Querysave(Source As Notesuidocument, Continue As Variant)

Dim s As  New NotesSession

Set db = s.CurrentDatabase
Set form = db.GetForm("lotusTip")

Dim xpageStr

Forall field In form.Fields


    Messagebox(field)   
End Forall

End Sub

3
Are these XPages Tips? If so are they available to the community at large? Or is it just a private resource?David Leedy

3 Answers

3
votes

Define the XPage you want to open a form with in forms properties:

enter image description here

This way your URL http://server/database/0/...UNID...?OpenDocument will work.

0
votes

To open XPage in Notes client use notes url syntax:

notes://server/path/database.nsf/pagename.xsp?openXpage
0
votes

If you're trying to identify which XPage a Form opens with, that's defined in the $XPageAlt field for web and $XPageAltClient field if you have a specific alternative XPage to open for XPiNC. You can create a NoteCollection to retrieve the Form, then access that element.

It's something we've extended in OpenNTF Domino API, with a Document.getForm() method to easily retrieve the form and a Form.getXPageAlt to retrieve the XPage name.