www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    javascript question about modifying a query
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Zoe
Posted
Hi,

I want to have a button that will let me modify a query without having to specify the Query screen--I want it to just use the Query screen that was last specified.

The Inmagic help says "selectQueryScreenEx (queryScreen) specifies the query screen to select for the Query window. If the argument is an empty string or null, the query screen previously selected is unchanged. "

So I thought I could put:

function modifySearch_onClick()
{Command.selectQueryScreenEx("");
}
and under Names I have a button named modifySearch.

I hoped it would take me back to whatever the Query screen was, with the query displayed, but it does nothing. It only works if I specify a Query screen. But if I do that, then I can't use the same report for two different users (who need different query screens).

Thanks for any help.

Zoe
 
Posts: 62 | Location: Beverly Hills, California | Registered: Thu February 03 2005Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
How about just a script that closes the Report Window, which would return the user to the Query window, which is presumably behind the Report Window (because you have the Report Window maximized)?

function modifySearch_onClick()
{
Command.closeWindow();
}
 
Posts: 217 | Registered: Wed June 29 2005Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
Hi ---

You could use the session store object to store the query screen name whenever a query is executed, then pick it up and use it for selectQueryScreenEx.

query screen:

function onQueryExecuted()
{
Application.sessionStore.value("lastQueryScreen") = Window.formName;
}

report page:

function modifySearch_onClick()
{
var screenName = Application.sessionStore.value("lastQueryScreen");
Command.selectQueryScreenEx(screenName);
}


Peter Tyrrell, MLIS
Senior Consultant
Andornot Consulting Inc.
http://www.andornot.com/about/developerblog
 
Posts: 179 | Location: Vancouver, BC, Canada | Registered: Thu September 20 2001Reply With QuoteEdit or Delete MessageReport This Post
Zoe
Posted Hide Post
Yes, thank you, that's just what I need.
 
Posts: 62 | Location: Beverly Hills, California | Registered: Thu February 03 2005Reply With QuoteEdit or Delete MessageReport This Post
Zoe
Posted Hide Post
(I used CDale's solution, just to clarify. I thought that was the one I was responding to, but I see it wasn't.)
 
Posts: 62 | Location: Beverly Hills, California | Registered: Thu February 03 2005Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    javascript question about modifying a query