An when I had logged out and in again I started to work again.
No error message on the server nothing.
Strange,
/Fredrik
The Code that didn't work
var v=database.getView("(ByUNID)") // first column sorted with formula @Text(@DocumentUniqueID)
v.refresh()
var key=viewScope.UNIDKey // holds the UNID of a document
var doc:NotesDocument=v.getDocumentByKey(key,true)
print(doc)