Jump to content

Set Variable Script Step?


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

Recommended Posts

Hi All, at the moment I use an "If" statement in the "Set Variable" script step to utilize the same script on several different layouts.

If ( Get(LayoutName) = "Stock Requests" ;

Stock Requests::StockID_SK;

Purchase Order Records::StockID_SK )

I would like to make the layout name change dynamic so what ever layout I am on is part of the value = set variable script step, is this possible?

Eg. The value part is Stock Requests::StockID_SK on one layout but it is Purchase Order Records::StockID_SK on another.

All the other script steps are the same for every layout.

Thanks Peter :-)

Edited by Guest
Link to comment
Share on other sites

Hi mr_vodka, thanks, your suggestion worked on one but not the other. The one that is not working is actually a portal so it's returning the name of the active window that contains the portal not the source layout.

I've had a look at the various function options but haven't managed to find a way around this.

Cheers Peter :)-)

Link to comment
Share on other sites

Hi All, at the moment I use an "If" statement in the "Set Variable" script step to utilize the same script on several different layouts.

If ( Get(LayoutName) = "Stock Requests" ;

Stock Requests::StockID_SK;

Purchase Order Records::StockID_SK )

I would like to make the layout name change dynamic so what ever layout I am on is part of the value = set variable script step, is this possible?

Eg. The value part is Stock Requests::StockID_SK on one layout but it is Purchase Order Records::StockID_SK on another.

All the other script steps are the same for every layout.

Nowhere in your OP does it mention a portal relationship. For a portal, you can not do what you are trying to achieve via this method. If you had 8.5 you may be able to use GetLayoutObjectAttribute to get the Portal's table name.

What is the purpose here? It may be beter to pass a script parameter on the button to the script. Then you can pass the portal relationship TO name or the layout's TO name, etc.

Link to comment
Share on other sites

  • 1 month later...

Hello,

I have a related question & would appreciate any helpful feedback.

My system is one database with several Tables. These Tables are very similar with a few field eexceptions:

To simplify ;)

1 Table has Field 1, Field 2 & Field 3.

The second Table has Field 1 & Field 3

The 3rd has only Field 2.

Is it possible to have 1 layout which would show the Field names based on the Table involved.

I'm trying to get a grasp on Script Parameters because I feel that might be the way to go but can't find a solution.

There are actually 11 layouts involved & every time a small change is needed, say unjderlying another field found on all 11 layouts, it's got to be done 11 times !

Thanks in advance,

Geo.

Link to comment
Share on other sites

There seems to be some confusion here. Layouts exists to display the data. The data is stored in field within tables. If you have the same data that exists in multiple tables then you may want to relook at why its setup that way. The key is minimizing repeating data.

Link to comment
Share on other sites

Thanks mr_vodka for your speedy response - & I'd like to excuse my defining the problem in an unclear manner.

There is only 1 Table for the moment & the layout chosen depends on the "Type" chosen in the pop-up. For example ;) if the "Type" chosen by the user is floors, then he is taken to the "floors" layout which, coming back to my example, has field 1 & field 2. If he chooses "ceiling" the layout he is taken to shows field 2 & field 3.

Again, I would like to have only 1 layout, if possible, that shows the fields that that "type" could have filled in.

I hope this is clearer & will prompt other "solutions"

Thanks again

Link to comment
Share on other sites

You can take a look at this sample and try to implement the Visability Technique.

It will allow you to hide and show fields on conditions.

That being said, you may want to consider using a tabbed interface instead of a pulldown. This way you would be using one layout.

Link to comment
Share on other sites

Thanks again but I wanted to learn about script parameters & to know if that method was appropriate in my case and if so, some help in that area.

The layouts are already set up & I'd prefer not to replace them except by 1 (layout).

Any other responses would be greatlyb appreciated.

Link to comment
Share on other sites

Again, I would like to have only 1 layout, if possible, that shows the fields that that "type" could have filled in.

The layouts are already set up & I'd prefer not to replace them except by 1 (layout).

Which is it? Do you want to keep the multiple layouts of do you want ONE layout. Are you looking for some sort of navigational layout? I do not believe you are making yourself clear.

Script parameters are basically values that you can pass along when your script is being called. You can typically pass a script parameter when assigning a script to a button or when you are calling a subscript from a script.

So you could have a global field with a pulldown menu, and then hit a button while passing the script parameter. But how will this dynamically change your ONE layout?

Link to comment
Share on other sites

Sorry again.

I would like 1 layout to represent 2 "Type" choices.

The user is in a View as Form layout. He/she clicks on the field Type & chooses from a drop-down list ;) floors or ceilings.

He/she is taken to this 1 layout which lists the fields designated from the type chosen.

Floors ;) he would see fields : floor.material & floor.color

Ceilings : he would see the field : ceiling.height

How about that ? I hope it's clearer ...

Link to comment
Share on other sites

This topic is 5667 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
 Share

×
×
  • Create New...

Important Information

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