0
votes

I have an xpage that has a view (Orders by Order Date).

I have an xpage that the user chooses the customer ordering the product on one section of the xpage. Another section of the xpage they order the products. As soon as they add the first product, the customer info is saved (data source: form "fOrderForm"/document1 on xpage). Each product ordered is stored as separate Notes documents (fOrderLineItem/docLineItem) with the order ID as lookup on the data grid on the combined xpage.

On the view xpage, when I click on one of the orders, the system is giving me an invalid Universal ID error even though the ID is in the URL. Do I have to manually load each field on the document1 data source in the after/before page load event and set the scope variable that the data grid uses? If I remove the xpage associated with the Notes form, it opens correctly but that isn't going to work.

A URL from the view is http://localhost/SalesOrders.nsf/xOrderForm.xsp?documentId=CADCB3E38FF310EA85257F8100493670&action=editDocument

Error log:

com.ibm.xsp.FacesExceptionEx: Could not open the document
    com.ibm.xsp.model.domino.DominoDocumentData.doOpenDocument(DominoDocumentData.java:509)
    com.ibm.xsp.model.AbstractDocumentDataSource.openDocument(AbstractDocumentDataSource.java:148)
    com.ibm.xsp.model.AbstractDocumentDataSource.load(AbstractDocumentDataSource.java:100)
    com.ibm.xsp.model.AbstractDataSource.getDataContainer(AbstractDataSource.java:474)
    com.ibm.xsp.model.domino.DominoDocumentData.getDataObject(DominoDocumentData.java:145)
    com.ibm.xsp.model.AbstractDataSource.pushData(AbstractDataSource.java:576)
    com.ibm.xsp.util.DataPublisher.publishControlData(DataPublisher.java:181)
    com.ibm.xsp.component.UIViewRootEx.publishControlData(UIViewRootEx.java:1288)
    com.ibm.xsp.component.UIViewRootEx.initBeforeContents(UIViewRootEx.java:1615)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:333)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(AbstractCompiledPage.java:167)
    com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(ViewHandlerExImpl.java:521)
    com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(ViewHandlerExImpl.java:567)
    com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(ViewHandlerExImpl.java:142)
    com.ibm.xsp.application.ViewHandlerEx.createView(ViewHandlerEx.java:90)
    com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:251)
    com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
    com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
    com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
    com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
    com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
    com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
    com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
NotesException: Invalid universal id
    lotus.domino.local.Database.NgetDocumentByUNID(Native Method)
    lotus.domino.local.Database.getDocumentByUNID(Unknown Source)
    com.ibm.xsp.model.domino.DominoUtils.getDocumentById(DominoUtils.java:456)
    com.ibm.xsp.model.domino.DominoUtils.getDocumentById(DominoUtils.java:477)
    com.ibm.xsp.model.domino.DominoDocumentData.doOpenDocument(DominoDocumentData.java:489)
    com.ibm.xsp.model.AbstractDocumentDataSource.openDocument(AbstractDocumentDataSource.java:148)
    com.ibm.xsp.model.AbstractDocumentDataSource.load(AbstractDocumentDataSource.java:100)
    com.ibm.xsp.model.AbstractDataSource.getDataContainer(AbstractDataSource.java:474)
    com.ibm.xsp.model.domino.DominoDocumentData.getDataObject(DominoDocumentData.java:145)
    com.ibm.xsp.model.AbstractDataSource.pushData(AbstractDataSource.java:576)
    com.ibm.xsp.util.DataPublisher.publishControlData(DataPublisher.java:181)
    com.ibm.xsp.component.UIViewRootEx.publishControlData(UIViewRootEx.java:1288)
    com.ibm.xsp.component.UIViewRootEx.initBeforeContents(UIViewRootEx.java:1615)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:333)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(AbstractCompiledPage.java:167)
    com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(ViewHandlerExImpl.java:521)
    com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(ViewHandlerExImpl.java:567)
    com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(ViewHandlerExImpl.java:142)
    com.ibm.xsp.application.ViewHandlerEx.createView(ViewHandlerEx.java:90)
    com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:251)
    com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
    com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
    com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
    com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
    com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
    com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
    com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
1
Do you only have one dominoDocument datasource on the xOrderForm XPage? If more than one, the error could relate to any. Also check ignoreRequestParams settings and others. Also, I think many are assuming the link to open it is automatically assigned from a View Panel. If not, check that too. - Paul Stephen Withers
IT was caused by an unused document data source. It took "weeks" to find this out. Thanks for the suggestion, it caused me to look at that which I wouldn't and didn't do previously. - Mike Gonzalez

1 Answers

0
votes

I suspect it is a question of sequence. A new document in memory gets a temporary UNID only. Once it is saved a UNID based on the time of the first save is created. It looks like you capture the UNID to put it somewhere before you save the document for the first time. You need to change the sequence of events to update the UNID wherever you store it.