• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

$$Return on the web

I'm trying to fix someones database.  They use a $$Return field in a form to return to a previous view where they came from:

go1 := "<script>history.go(-2);</script>";
go2 := "<script>history.go(-3);</script>";

They do this so they don't have to hardcode a view name in the $$Return field because they could have came from a number of different views.  This actually works, however when they are returned to the original view it does not REFRESH/RELOAD the view.  Is there a way to make the view refresh?

1 Solution
Bset method is to use http_referer in the document and your $$Return field would be

"[" + http_referer + "]"

I use a frameset myself.
In the onLoad event of a view's $$Viewtemplate (if you use embedded views, you may just as well put in on the form's or page's onLoad-event) a set a variable in the "top"-level (frameset). As the frameset is never reloaded, the variable is safe there.
I use the variable to count the number of steps to go back in history (view sets variable to 0, forms/pages increase it by 1), or to store the view's actiual URL in.

The variable is read again when a user goes "back" to a view. The counter would actually go back in the history; NOT reload the view. It only avoids the if-construction.
Storing the view's URL, however, would solve your problem: instead of going back, you load that URL again:

I prefer this method over http_referer as -in a number of applications- a "create new document"-button, first brings up a pop-up to allow a user to select a form-type. Http_referer would then refer to that pop-up. In normal situations Hemanth's solution should work just as well!
Hello Sno,

how about this:

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

snocrossAuthor Commented:
Ok, I will test your ideas... thanks.
snocrossAuthor Commented:
Zvonko, I tried your solution but it keeps repeatedly RELOADING the page and I can't get it to stop with pressing CTL+ALT+DEL!
shock!!!  :-)

...but to save my wizzard state I propose this:
"[/" + @SubSet(@DbName;-1)+"/"+@SubSet(@ViewTitle;-1)+"]"


(of corese this is working only if you select one document from a view and then after doing some steps press  on a button containing something like:

If you do not come into the document from a view but perhaps from ?OpenForm, than above $$Return formula opens simply the database...

Is this OK for you?


snocrossAuthor Commented:
That worked beatifully, thank-you.  Thanks to everyone else for their suggestions too.
thanks for the points and for the feedback Sno <|;-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now