thanks, but as I said it's important not to save the document. The other app is owned by other people, so no messing around with their design. All my code does is help to prefill some fields and leave all validation to the original app.
The solution I finally found is to put the doc creation and opening code in an agent. I cannot launch this agent directly from XPage even by using notes:// url (I get "Command not implemented" error), however I can use notes:// url to open another Notes native element such as a page, put a line source.close in the PostOpen event and in QueryClose call the agent. Kind of doing simple things the hard way, but at least it does what I need :-) Will try to figure out now how can I pass info which context doc to use, but I assume passing the url parameters should work well enough.
EDIT: Well a bit naïve from my side. @urlquerystring does not seem to work with Notes url. Some more hack needed :-) I guess from XPages I cannot use notes.ini as well... can I? so have to pass the info through some data document.