JavaScript and window.open method

I have a problem to open a document in a new window from the Client.I was able to open a form

window.open(‘/Test.nsf/Help?OpenForm’,‘’,‘width=440,height=190’);

But…I need to open a document in a new window

I’m getting the error 'The document specified by the link can not be located within the linked-to database

window.open(‘/Test.nsf/Help/ERAK-69E2LK?OpenDocument’,‘’,‘width=440,height=190’);

Subject: JavaScript and window.open method

Eve,

You have the wrong syntax. The Domino URL for a document requires the 32 byte universal ID and is of the form:

/database.nsf/docid/universalID?OpenDocument

Ken

Subject: RE: JavaScript and window.open method

Not necessarily – you can use a key value, but that value MUST appear in the first column of the view, and that column MUST be sorted. Please see the Domino URLs section of Designer Help for more details. Unlike the UNID method, the document must actually appear in the view in order to retrieve the document (so using empty views for form formulas is out of the question).

Subject: RE: JavaScript and window.open method

My view is sorted by the unique key but I am still getting the same error from the Client siteHere is my code:

window.open(‘/Test.nsf/My/ERAK-69E5XA?OpenDocument’,‘’,‘width=440,height=190’);

Subject: RE: JavaScript and window.open method

that syntax should be fine assuming the first column of the view ‘my’ is sorted, and the document with the id ‘erak-69e5xa’ appears in that view. if not, the function will fail. try opening that URL directly (i.e. type it in). if it still fails, your problem is with either the view sorting, or the selection formula, or the document id used in the first column.

Subject: RE: JavaScript and window.open method

I have tested on the Browser and my code is OK. I only have a problem to open the document from the client site.I get the error ‘The document specified by the link can not be located with the linked-to database’.

window.open(‘/Test/Test.nsf/My/ERAK-69E2LK?OpenDocument’,‘’,‘width=440,height=190’);

Where ‘My’ is the view with the first column sorted by @Unique; ERAK-69E2LK is document uniqueID.

Subject: RE: JavaScript and window.open method

Two things to check: the column sorting in the ACTUAL database (not the template or a different replica) and access to the document/view from the problem location. Can you open the same document by UNID from the client site?

Subject: RE: JavaScript and window.open method

Stan, Thanks so much!!! When I used @Text(@DocumentUniqueID) instead of @Unique it works.