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.

Scripts and Pull Down Menus

Featured Replies

Is there a way to write a script that will run after a selection is made from a pull down menu?

Example:

Pull down Menu item is selected (Active) as soon as the selection is made a script runs...

Thank you,

Joseph

Hi, just found this plugin,

zipp-script...

demofile is on this site....

http://www.nightwing.com.au/FileMaker/demos8/demo806.html

regards

  • Author

Is there another way?

Nope,

The only other way is a button next to your dropdown field

'GO' and attach your script to that button.

I did see reference some while ago to a technique that used a global a pause and a loop.

If I remember rightly (risky!!) A script was triggered on entry to the field which first stored the current contents of the field that holds the drop down menu into the global, then pauses for a short duration then checks if the global still matches the contents of the field. It keeps looping round until the contents of the field no longer match the contents of the global indicating that the user had made a new choice. It then exits the loop and does whatever was wanted.

Quite what it did if the field did not change I cannot remember but I mention all of this only because I think that maybe one can come out of a value list and trigger an event

When I looked at the sample file it worked but was very 'flashy' and a bit too distracting to be worth considering

I think this thread was in the FM Cafe

Sorry I cannot be more specific.

Phil

To loop a script is not an elegant solution and totally not idiot proof.

You should need an errorCapture and userAbortOption while you

are not in a dialoge-window.

It requires to loop the script in the userinterface when idle ?

Meanwhile other solutions in fmpro wil slow down, if they wil work at all.

Therefore I prefere my second option.

Still working my way throug the plugin, wich seems to do just fine.

Although the plugin is Free, the documentation is quite summier.

You have to figure out how it works working your way through the

samplefile(s)

Quint

On Windows, you can do exactly what you want without a plugin. I use this technique all the time with no adverse consequences. Make sure the field does not allow entry. The field must be formatted as a Popup Menu, not a Drop-down list!

AllowUserAbort(Off)

GoToField (fieldwithpopup)

Pause/Resume(1 sec)

Commit Record/Request

rest of script

The 1 second pause is necessary to cause the list to open.

Steve

  • Author

Great thanks, I will give this a try... Seems really easy... This way I do not have to be worried about someone forgetting to click a button after a new items has been selected...

Will let you know...

Joseph

I use (used) it also. But attaching a script to popup menu can crash client in 8.0v1 so be sure you're on 8.0v2. We dropped back to 8.0v1 because of the regression issue and all my scripted popups began to crash us. The bug is documented in Tech Info.

But I love the technique and, being on windows, it DOES work a treat. BTW, I've tested in 8.0v2 and it works wonderfully again. I can't wait to move us forward again. In the meantime, I've had to switch to event triggers to fire them. :wink2:

  • Author

Works Great... I need to upgrade to 8v2 I guess.

Thanks to you all

Joseph

this looks great,

It does require a script to start in the first place ?

somethings puzzles me, For what purpose would you use this ?

For validation or a real action (complete script) after this field has been entered.

At first I thougt it would be for navigation purpose or something.

But I understand it is not 'just' a given field waiting to be entered?

"It does require a script to start in the first place ?"

Since your turn off 'Allow Entry' to field, it must be clicked which activates the attached script. The script takes it from there, pausing for input, then finishing the script.

Example of its use: Every time someone changes data in a certain text field (the popup), I want to generate a new record (creating an activity for that person to do certain work), depending upon their choice. Script can have script parameter attached to grab the original value. After selection is made, script tests: If [ popupField = Script(Parameter), Commit and Halt, Else (do your new record stuff).

UPDATE: This ALSO works great with Go To Layout[] etc so can be used (and I've used it this way in vs. 6) for navigation. Just attach it to global text.

Edited by Guest
Added Update

Thanks miss LaRetta,

With this info I could think of some purposes and maybe I will implement it

sometimes but for now I don't think I would use this technique.

I use zipscript to update a highlight in listview and watch a global-searchfield

When something entered in 'search', when exit the field auto search is

initiated.

The pulldown should work for me for navigation so I will keep it

in mind.

still curious where joseph will use this for.

Quint

btw, working on a mac, Will this work on mac also ??

or I could simply try it..... }:(

Edited by Guest

Oh. No. Sorry Quint. For once, this is a Windows bonus. It would help if you updated your profile so everyone knows your OS and FM version. I would have responded differently knowing you were Mac. Well then, it's a good thing you probably wouldn't use it anyway. But you can use event triggers - you still have the script but you just wouldn't fire it from the popup itself.

I don't yet have a Mac so I haven't tested scripting on them with vs. 7 or 8.

LaRetta :wink2:

It's also useful in a portal when you have a popup menu. Sometimes I'll use it only to cause the portal to refresh. In other cases, values that the user selected in the popup would cause me to chnage other fields. For example I have a Status Field and a Date Completed Field. When the user changes the Status to 'Completed', I automatically fill in the Date Field with the current date.

To make it work, attach the script directly to the field that's formatted with the popup.

Steve

Edited by Guest

Well, I just tested it and indeed it didn't work as expected.

However a pause indevenetely will do but an physical enter has to be made

to resume the script.

Quint

/*I updated my profile as requested, love/*

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.