Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

triggering a script with data entry via a pop up menu

Featured Replies

I have a field called Activity. The field is formatted with a pop up menu containing 4 choices. The 4 choices coincide with layout names.

What I would like to happen is:

Upon data entry, the user selects "papers" from the pop up menu, he will then be directed/rerouted to the "papers" layout. If the user selects "presentations", he will be directed/rerouted to the "presentations" layout, etc.

I have downloaded the EventScript plug in but I cannot figure out how to make it work.

Anyone? :

Try something like this.

You will need to have your value list (Papers, Presentations, etc)

You will need to have a [color:blue]global field called: gActivity

You will need a script called: SwitchLayout

and then in your field gActivity, use this script to envoke the plugin.

If ( Get ( ActiveFieldName ) = "gActivity" 

and S4HU_EventScript (Get ( FileName ); "SwitchLayout"; "" ) = ""; 

          gActivity;

          gActivity 

    )







Then in your your script SwtichLayout, you can have a If statement like:




If gActivity = "Papers"

      Go to Layout [papers]

Else If gActivity = "Presentations"

      Go to Layout [presentations] 

      ...

End If

One more thing. I think this post may belong in the Plugins section rather than the ScriptMaker forum.

Mod, can you move this thread if you agree?

  • Author

It looks so simple but it doesn't work. I noticed a change in your post. The first (gActivity) script you showed gives me errors: "(" don't match if the If the "IF" is gone, if I leave the "IF" the table cannot be found.

mr_vodka's orginal script:

--If ( Get ( ActiveFieldName ) = "gActivity" ; If ( S4HU_EventScript ( Get ( FileName); "SwitchLayout" ; "" gActivity; gActivity ) ; gActivity )--

When I try to use the changed script the table still cannot be found.

Try something like this.

You will need to have your value list (Papers, Presentations, etc)

You will need to have a [color:blue]global field called: gActivity

You will need a script called: SwitchLayout

and then in your field gActivity, use this script to envoke the plugin.

If ( Get ( ActiveFieldName ) = "gActivity" 

and S4HU_EventScript (Get ( FileName ); "SwitchLayout"; "" ) = ""; 

          gActivity;

          gActivity 

    )







Then in your your script SwtichLayout, you can have a If statement like:




If gActivity = "Papers"

      Go to Layout [papers]

Else If gActivity = "Presentations"

      Go to Layout [presentations] 

      ...

End If

[color:blue][color:blue][color:blue]

Well I just shorted up the code from the original post and thought that I had changed it in time. It doesnt matter though which one you use. They both should work. However, the second one is much shorter.

Try this attachment.

EventScript_sample.zip

  • Author

THANK YOU! It works.

My mistake was not using a calculated value in the gActivity field.

The attachment was a huge help. Thank you for putting it together so quickly.

Happy 2006!

Well I just shorted up the code from the original post and thought that I had changed it in time. It doesnt matter though which one you use. They both should work. However, the second one is much shorter.

Try this attachment.

For the same purpose, I personally prefer to use this kind of calculation in the auto-enter option:

// If the current active field is the navigation global

If ( Get ( ActiveFieldName ) = "gActivity";



   // Then do the auto-enter option AND trigger the target-script

   gActivity & S4HU_EventScript (Get ( FileName ); "SwitchLayout"; "" );



   // Else, simply do the auto-enter option

   gActivity

)

I found this one easier to read. :

BTW, nice demo Mr. Vodka !!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.