This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 5, 2013, 8:54 AM
10 Posts

The document specified by the link cannot be located within the linked-to database

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 0

Hi All

I have an xpage (XPINC) with a button from where I'd like to open a particular document within the notes client. The db referenced below in the button's SSJS is in a different database to the xpage & button. Unfortunately I'm getting a "The document specified by the link cannot be located within the linked-to database." error when running the view.postScript("window.open('" + cdoc.getNotesURL() + "')") code. Now if I leave the page and open the db (and either leave it open or close it) via the notes client and then go back to the xpage and click the same button, it opens the cdoc no problem in the notes client UI. From then, every time I click the button it works UNTIL I restart the notes client then it no longer works.

 

var db:NotesDatabase = session.getDatabase(viewScope.get("SVR"),viewScope.get("PATH"))

if (db != null){
    var vw:NotesView = db.getView("LookupDocs")
    var cdoc:NotesDocument = vw.getDocumentByKey(document1.getItemValueString("itemRefence"))
    if (cdoc != null){
         view.postScript("window.open('" + cdoc.getNotesURL() + "')")
    }
    else {
         view.postScript("alert('Document not automatically found - please try a manual search ');");
    }
}
else {
     view.postScript("alert('Database on " + viewScope.get("SVR") +  " cannot be found automatically.');");
}

 

In testing if I try the button in the same db as the cdoc (ie var db:NotesDatabase = session.getCurrentDatabase()) - it works no problem. Also if I have a if (db.isOpen()) statement, it passes through that fine and into the relevant code.

 

Does anyone have any ideas of how to get around this?

Regards

Steven

 


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal