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

How to trigger an external script based on a value


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

Recommended Posts

Posted

I have a calendar solution with a value list containing 3 choices.

The choices represent 3 differnt layouts in file B.

When I select a date and goto the related record in file B, I'm using an external script from file B to goto one layout. I need it to go to the appropriate layout depending of the choice of the value list.

How can I script this?

Posted

A couple of ways... one is to put the value list choice into a global field, and then reference the global through a relationship in the related file.

Another is to make multiple scripts in the related file and choose the appropriate one to call externally. (This is the least elegant IMHO.)

Posted

Hi Lee,

You can pass script parameters between files and between scripts.

Attach a script parameter to your Date Selection button. If you've never used Script Parameter, right-click your Date Selection button and Specify Button. Select Perform Script and Edit optional Script Parameter. You would just select your Value List field here. This will put the parameter on a 'script clipboard'.

Your external script (in file : - since it is executed within your file A script (parameters die when script ends), can then grab this parameter as Get(ScriptParameter) and use it as:

Go To Layout Name by calculation [ Get(ScriptParameter) ]

Not that I'm against globals, Vaughan, I love em. But Script Parameters tickle me also.

LaRetta wink.gif

Posted

Hi Lee,

What are your scripts in FileB? Are they basically the same except for the layout switch?

What I was suggesting is that you use only one script in FileB which you would call from File A when clicking your date selection. So, from FileA script, perform External FileB script - which would have the layout switch based upon Get(ScriptParameter) pulled from File A. You must call a script from FileB from FileA regardless; otherwise, how would it fire?

You can't run a script by specifying a parameter (or global) in the script name itself. For instance, you can't say:

Perform Script [ Get(ScriptParameter] ... or ... Perform Script [globalfield ]

And you can't say Perform Script [ by calculation] or Perform Script [ "any text" ] - you must instead choose an existing script. You can only use variables within script-steps themselves.

But ... if you run a generic script in FileB, you can use the script parameters within them, switching layouts as appropriate, depending upon your value list. It depends upon your 'already created' various scripts in FileB. You haven't given us much to go on. wink.gif

LaRetta

Posted

Wow. I'm a bit confused by what's being said there.

I have a Mac solution to this, but I can't get it to work elegantly in Windows.

Basically, you click on a drop down menu, which then displays the list. When you select one of the options, it immediately gets related info based on that value and does whatever else you specify in the script.

Is this what you're talking about?

Charlie

This topic is 7311 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.