Solved

On Cancel button click, return to view name passed in query string

Posted on 2006-11-13
8
362 Views
Last Modified: 2013-12-18

I have a form that I am trying to return to a certain view when either the Submit, Update or Cancel buttons are pressed. I pass the viewname as a query string parameter and have a field on the form called ViewName (code below).

In the cancel button I have the following code:
@URLOpen(Path +"/" +@Text(ViewName) + "?OpenView&RestrictToCategory=" + Component)

The ViewName field works because I can display it on the page, however when I click the Cancel button, the ViewName field returns an empty string, causing the URLOpen to fail. Why would this be? How can I resolve this problem?

thanks


ViewName code
-------------------
Parameter := "viewname";
NotFound := "";
ArgNames := @Left(@Explode(@Right(Query_String_Decoded;"&");"&");"=");
ArgValues := @Right(@Explode(@Right(Query_String_Decoded;"&");"&");"=");

REM "Check that the parameter exists";
Position := @Member(Parameter; ArgNames);

@If(Position > 0;
     @Trim(@Subset(@Subset(ArgValues; Position); -1));
     NotFound
)
0
Comment
Question by:jacy_m
  • 4
  • 3
8 Comments
 

Author Comment

by:jacy_m
ID: 17935852
Note, I also have the following code on the cancel button
Path := "/" + @ReplaceSubstring(@Subset(@DbName; -1); "\\"; "/");
0
 
LVL 19

Assisted Solution

by:madheeswar
madheeswar earned 150 total points
ID: 17936274
You can create a $$Return field which does this redirect based on a if condition.

Even you can pass the view name from the Query String as well.
0
 

Author Comment

by:jacy_m
ID: 17936771
I have never used a $$Return field before. Would I put the same code I had in the cancel button? Or do I need to refer to the Query String variable in a different way to make it work?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17937007
I think you might be mistaken in the moment of evaluation of the code in the Cancel-button. I assume that, at that moment, Viewname isn't computed (yet).

You could put Viewname explicitly in the QueryString, passing it as a parameter to your form.

For an alternative to
    Path := "/" + @ReplaceSubstring(@Subset(@DbName; -1); "\\"; "/");
see the @WebDbName function (if you have R6)
0
 

Author Comment

by:jacy_m
ID: 17940918

sjef_bosman:
I am passing "viewname" in the QueryString as a named parameter, which I am then using the field ViewName to reference (see code in my 1st post). I am a little unsure at what stage it becomes computed or not.

I am using R5 but thanks for your alternative though.

Sorry for any confusion... I am not a Lotus Developer, I am a VB developer and have been thrown into this job with some mixed results.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 150 total points
ID: 17941407
You might have to get Viewname out of the REAL Url, using JavaScript. Formula language is only interpreted on the Domino server. I'd have to have a hands-on example to be able to really help you.

Is Viewname a hidden field? Then you might not have it available on the form. An alternative would be to use the option in the Form Properties to Generate HTML for all fields (if it's available in R5). You're certain then that Viename exists in the browser as a field, and that you can assign a value to it using JavaScript.
0
 

Author Comment

by:jacy_m
ID: 17943311
I have managed to solve this using the details on the following page http://www.scottgood.com/jsg/blog.nsf/d6plinks/SGOD-6C3F6U

But instead of using a WebQuerySave, I just placed the javascript window.location change code directly into a $$Return field.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17945366
Thanks, also for the link!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lotus Notes 8.0 Forward emails for 30 days. 8 115
Lotus Notes 6.5.5 6 229
Username format for Domino LDAP 3 109
Why the url within notes is no action 6 56
For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question