2

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

Bryan Schmiedeler
  • 2,977
  • 6
  • 35
  • 74

3 Answers3

3

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.

Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67
  • Knut, thank you so much I only had the first checkbox checked and made a typo in my URL. Not I can get it done. Thanks again. When can I buy you a bunch of beers? – Bryan Schmiedeler Nov 14 '14 at 17:00
0

To open XPage in Notes client use notes url syntax:

notes://server/path/database.nsf/pagename.xsp?openXpage
Frantisek Kossuth
  • 3,524
  • 2
  • 23
  • 42
0

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.

Paul Stephen Withers
  • 15,699
  • 1
  • 15
  • 33
  • OK I am trying to write this. There is no other way to do this? – Bryan Schmiedeler Nov 14 '14 at 16:29
  • And I can't seem to access the element. I have got the form, look through the fields, but no $XpageAlt. See above for code. – Bryan Schmiedeler Nov 14 '14 at 16:32
  • Have you set the form to open in the relevant XPage you want? I thought that's what you were trying to get. I think Knut's got the answer, which is to set that. Then your current URL will always open in the XPage defined in the form. – Paul Stephen Withers Nov 14 '14 at 16:45
  • Yes I did set that property, but when I open the URL it opened the notes document, not the Xpage. Perhaps my syntax was incorrect. I have tried several. What is the correct URL?? – Bryan Schmiedeler Nov 14 '14 at 16:51
  • No, that should be correct. If you highlight the form in the Forms view in Designer and check the fields, is $XPageAlt set? – Paul Stephen Withers Nov 14 '14 at 16:54