Solved

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

Posted on 2006-11-13
8
363 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

707 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