1
votes

I have an Xpage with access set to public for clients to fill in a form. When I send the client the link to the page and they open it for the first time. Everything runs smoothly. However, if they close the browser and click on the link again they receive this error:

{Unexpected runtime error

The runtime has encountered an unexpected error.

Error source

Page Name:/xpClientForm.xsp

Exception

Could not open the document

Invalid universal id}

I am using a switch facet to cycle between forms depending on the client type. The domino document id is being stored in a sessionScope beforepageload and the document dynamically computes it based on that sessionScope variable.

Here is the code:

SessionScope assignment on beforepageload

var cData = getClientData(id);
sessionScope.docId = cData.docID;

Document datasource

<xp:panel style="height:100px" id="pnlDocData">
                    <xp:this.data>
                        <xp:dominoDocument var="document1"
                            formName="frmA" action="editDocument"
                            documentId="#{javascript:sessionScope.docID;}" scope="request">
                    </xp:this.data>
</xp:panel>

However when i execute this custom control on a page that does not have public access. It runs fine with no issues irrespective of how many times i open the link.

Any help will be greatly appreciated.

1
How do you calculate the universal id?Per Henrik Lausten
When the document is created on a separate xpage. The universal id is saved to an sql table under that clients name. The link sent to the client has his unique id for that table row parsed as a url parameter. I then use that parameter to make an sql call and get the universal id that was saved.Muhammed Ismail Carrim
The error says: Invalid universal id. Are you sure that the universal id is corrrect? Print it out in your beforepageload event and check.Per Henrik Lausten
Have printed it out. And everything was correct. Narrowed it down to the security access of domino documents by public access users. But not sure how to bypass this. Have made all documents available to public access users. Also tried the answer by Tawmess on This Question. This worked when i directly called getDocumentByUNID() but not when I compute the value in the as seen above. @PerHenrikLausten.Muhammed Ismail Carrim
Answer was found by @Tawmess on This Question.Muhammed Ismail Carrim

1 Answers

1
votes

You need to set ignoreRequestParams="true" on the dominoDocument datasource. Otherwise it's using the document ID in the URL or trying to create a new document, which the user probably doesn't have access to do.

Computing the document ID is the less common scenario, which is using the URL for document location is the default.