@commad([File Close window] is not working properly in web

Hi All,

I have “close” button and the code behind is @command([File close window]). but when I edit the document in the web and save and then close, sometimes it will go back to view and sometimes not.

The strange thing is that, when I open the document, click on edit then save and then again edit & save. after that if close it will behave like history.back.

My requirement is very straight, if user click on close it will back to the view from where the document is opened.

Can you suggest me something

Harshak

Subject: @commad([File Close window] is not working properly in web

If you’re using $$ViewTemplate for opening views then do something like this:

  1. Create a CFD field named ViewName with the following formula @Subset(@ViewTitle ; 1).

  2. Create a js function in the js header:

function backToView() {

dbname = YOUR DB PATH HERE

vwname = document.forms[0].ViewName.value;

location.href=“/”+dbname+“/”+vwname+“?OpenView”;

}

  1. For the Close button instead of using @command([FileCloseWindow]), call the above function onClick=“backToView();”

HTH

Sai

Subject: RE: @commad([File Close window] is not working properly in web

Hi Sai

thanks however I need to ask you question that if my close button in subfrom, not in the $$view template then?

Subject: RE: @commad([File Close window] is not working properly in web

You need to carry the ViewName value into you form either OnLoad of your form or from a WQO Agent. So when you open a document from a view ($$viewtemplate) the ViewName field value will be available.

HTH

Sai

Subject: RE: @commad([File Close window] is not working properly in web

Hi Sai

I understand that I have carry that value…but I don’t know how to carry? …like you mention through WQO or onload…can you pls elobrate …how to carry ?

Subject: RE: @commad([File Close window] is not working properly in web

I’m sorry. Just a monday morning hang over. You don’t need to carry the value etc…forget about that. If you just create a ViewName field with the formula @ViewTitle that should be enough. When you open a document it should evaluate to a view name from which it’s opened.

HTH

Sai