Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6957 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Is there a way to write a script using the Script Parameter Feature so that it will keep current even if you change the name of the layout involved?

My script looks like this:

Go to Layout [ Get ( ScriptParameter ) ]

Script Parameter = "General"

However, If I change the layout to "Basic Employee Data", my buttons no longer works because they are still looking for the Layout titled "General" as the Parameter for the script.

I did a search of the Forum, and I couldn't find where this was discussed before.

TIA

Lee

Posted

The script parameter is presumably fed to the navigation script from the button definition. So changing the value in the button definition should change what gets sent to the script.

Posted

Not sure I correctly understood your statement Lee, but it behaves as any quoted declared item within the database.

As with ValueListItems( ) as an example. If you change the list name, without changing it within the ValueListItems, it won't work.

There is no simple solution to that. You'd have to go back to the button definition and change its content again. Unless you rely on a related table for your parameters and then get a reference to it, so now the only thing you need is to change the value in the related table.

In some of my work, that"s how I've done it specially for window sizes. If the user finally isn't satisfied with that pop-up window size, I just have to reset its value in the related Table. It's a small tip but when you have plenty of buttons with parameters and want to change them one by one, it may take time.

Posted (edited)

Thanks Ender and Ugo for your prompt replies.

I was getting ready to respond to Ender with additional info, when Ugo's reply nailed it by confirming what I was seeing, but wasn't understanding why.

As with ValueListItems( ) as an example. If you change the list name, without changing it within the ValueListItems, it won't work.

Thanks again,

Lee

Edited by Guest
clear up the post a little
Posted

On a more positive note. A script parameter can be specified by a calculation. I am currently working on a template where I have a common set of ten navigation buttons across the top of each of the main data entry layouts. All of the buttons feed a pair of parameters to a script which simply goes to a specified window with a specified layout. The parameters are kept in a repeating field and any name changes are easily carried out in that one place. I guess a similar technique could be used for language changes with the addition of an extra repeating field for the button labels.

Posted

hi Jim,

You have described my file pretty well.

I guess the question that begs to be asked now, is what is the advantage of using a Script Parameter in this situation. Why not just use a Button and the Go to Layout, which will update when the layout name is changed.

Lee

Posted

Jim,

I'm really close to yours indeed. Each navigation buttons in my case has 8 parameters set all entered within a related External File and loading to repeating global variable on start-up.

Posted

Lee

In my situation I have to use a script because I am checking that a named window is open, and if not then opening it, followed by go to Layout in that window. On a Go to Layout situation you don't need to script, then you can achieve the same result doing a Go To layout by calculation and pick up the layout names from a repeating field.

Ugo

My situation is single-user as yet but that is a useful technique to be aware of, thanks.

Posted

This is a sort of progress report which I thought I would share with you.

I implemented the button labels as a repeating field. My buttons are all the same size so I simply laid all 10 repetitions across the buttons suitable size and see through to the graphic behind. This caused a problem. When the button was clicked the whole field was selected and it was impossible to tell which button had been clicked. So my first "tip" separate the repeating field into its repetitions and place the individual repetitions on the button graphics.

The next task was to finally implement the script parameters using the two repeating fields. After I had changed the script and put in a couple of button parameter calculations I had one of those "YOU STUPID..." moments, what was I doing? - calculations within script parameters when the script itself was quite capable of doing them.

So the button parameter is simply the number of the button relative to the repeating field of labels. The script then extracts the data from the parameter repeating fields using the button number as a repetition number. This has huge advantages as the number of parameters is set by the script not by the button!! If I want to add extra parameters I have only to set up the necessary repeating fields of parameters and then add the additional steps to the script and conversely if I want to reduce parameters the same thing is true.

This topic is 6957 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.