Passing parameters from menu to grids/forms

I’d like to pass a different parameter to a grid or a form (global variable, in order to make selective SQL conditions or autocompiling searching fields) by clicking on different menu items!!!


Alessandro from Italy

Good question, afaik you cannot add ?a=b to the link which is a feature request I guess. If you need this then you might try to use a small blank application and put a sc_redir(…) in that. It’s a dirty solution, but it might work for you. Each filter get his own app and in the redir you can set the parameters or set a global var.

Hello,

You can always set a global variable and use it across applications.

For instance, on my Grid application, before a redir I can set:

[globalVar] = {someFieldValue};
sc_redir(myForm);

Then on myForm I can use [globalVar].

regards,
Bernhard Bernsmann

Yes, but you cannot do that from a menu item!!

We really need this feature. It doesn’t make sense that you cannot even pass a parameter/global variable without doing all sorts of workarounds.

Hello,

You mean by not declaring global variables through code?

regards,
Bernsmann

Hi. let me clarify my need on this - I also have been stumped by this:

I have a blank SC V6 app called blogpost. It looks up a record in a DB table called blogpost, fetching a title, body, and other related values, based on a WHERE PostID = ‘[v_PostID]’
All is great, except that from any SC menu I can’t simply put in code that will get me to this app, with v_PostID set correctly.

For instance, I want to show one of these posts as an informational page called ‘Sticky Post’. I need to be able to specify the app link in the menu item as: blogpost?v_PostID=123

Easy solution?

So this might be ment to be a rhetorical question, but the problem is: YES, by not declaring variables through code.

I have a table with texts and tags and another table with these tags.
So the Tags can be edited (“first Tag”, “Grey Tag”, “Day”, “Night”, “Cat”…)
And the texts are all subjected to one of these Tags (“first Text…”->first Tag", “anoter Text…”->Day, “a really long Text” -->first Tag, “just a Text”->Cat, “one more text”, ->cat)

so I now have a form to edit theese texts, which works perfect with “select… where tag=[tagname]”

but i have to choose from somewhere what to set into “[tagname]”
and because user can edit these tags inside the second table I now just cant use menu-app to let the user select, which kinds of texts he wants to edit. I have to set up a new form app, choosing in a select-field which tag to use, setting this into global [tagname] and than redirect to form.
we have options to dynamicly add and remove items to and from menu - but this does not help if we cant pass a parameter.
it works with a select-form redirecting to text-form, but when you use menu all the time it is stupid to change the way how the user navigates here. it would be “nicer” when right in my menu there is a dropdown like “edit text with tags —> cat, day, tag, tag2, tag3…”

[QUOTE=bartho;11283]Hello,

You can always set a global variable and use it across applications.

For instance, on my Grid application, before a redir I can set:

[globalVar] = {someFieldValue};
sc_redir(myForm);

Then on myForm I can use [globalVar].

regards,
Bernhard Bernsmann[/QUOTE]

Hi Bartho, Where in my Grid can I set that [globalVar]?

Don’t necropost please.

Anywhere you write a word between brackets, for SC this means a global var. Check this: http://www.scriptcase.net/scriptcase-videos/

If you have more doubts, open a new thread. Closed thread.