logo

New Response

« Return to the main article

You are replying to:

  1. There are two drawbacks to that idea. The first is that the document is returned by using the equivalent of GetDocumentByKey, which is slower and more "expensive" than GetDocumentByUNID, so it might not be appropriate for high-volume applications. The second is also that the document id returned by the equivalent of GetDocumentByKey. It may seem absurdly obvious, but a document actually has to appear in a view in order to use a key value. It doesn't have to appear in the view in order to use the UNID. Why would that matter? Two words -- FORM FORMULAS.

    It is not at all uncommon in a Domino web application to make extensive use of form formulas in order to restrict access to data. Who has access to what data is determined by security settings on views that have form formulas. A user may have access to a document with a unid like 467CC5B0001BF79A86256E54004A77F0, and can read the document using this URL:

    http://www.codestore.net/comments/467CC5B0001BF79A86256E54004A77F0

    The same user would not have access to the same document using this URL:

    http://www.codestore.net/admin/467CC5B0001BF79A86256E54004A77F0

    When you use a technique like that, you need to have the view that is used in the URL in order to use its form formula -- but that view does not have to contain even a single document if you use the UNID. If you use the key, the document must, of course, appear in the view.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: