When using a link to open a document a strange error came up. An error that involved a field that had no relation to the document.
This was caused by a form formula in the default view fo the database.
Change or remove the form formula and it worked ok.