It suppose to retrieve the view name stored previously, but sometimes, it is returning any other viewname, only after many “New Topic” and “Cancel” clicks, the profile field seems to have the correct value stored. It could be an issue related to cached profile on web?.
There is no problem when an existing document is opened, because, I am using directly the @Subset(@ViewTitle; -1) to the open view, and profile document is not involved.
Thanks for your answer, I tried HTTP_Referer, but only get value when open an existing document in read mode. When enter in Edit Mode (using @command([EditDocument])) or when Creating a new document (using @command([compose])), HTTP_Referer returns an empty string.
I have put a field called HTTP_Referer, computed when display, with value to HTTP_Referer. Also have tried with Computed, en Editable with similar results.
I have change my action buttons to Jscript and storing in a cookie the window.location before change it to ‘/db.nsf/myform?openform’. After open the new document. I’ll read the cookie and set a field with its value. I’ll use that value in the ‘Close’ action.
Finally I have found the solution using JScript and Cookies, thanks to AdiBabu K for let me see the ligth at the ond of tunnel ;-).
Changed all formulas related to compose and file close, to javascript. I code some functions to change window.location with a calculated URL, even when the document to create is a response and need the ParentUNID parameter.
The change involves views, view templates, forms and script libraries for handle cookies.