Jump to content

How to trigger a script automatically?


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

Recommended Posts

You can attach a script directly to a field which will execute upon field entry. If you script your new record creation you can continue your script after the New Record Request script-step. If you want a script to run after creating a new record via menu or shortcut keys, you will need a plugin.

But oft times, lantech, there are lateral solutions with FM. If you describe what you wish to accomplish someone here may have further suggestions.

Link to comment
Share on other sites

Moonshadow,

Where could I learn more about how to "attach a script directly to a field which will execute upon field entry".

I would like to be able to check a YES-NO checkbox and then, based on which selection I made, trigger a YES script or NO script.

Could someone explain more about this?

Thanks,

Jarvis

Link to comment
Share on other sites

Jarvis,

Moonshadow is correct you make a field a button. And when you click on the button trigger a script. That can delay via a looping script. Then when your criteria is met have it execute another step.

Filemaker doesn't execute a script upon exit of the the field. with out the use of a plugin.

Link to comment
Share on other sites

There are many variations on this theme and I suggest you do a search for checkbox and radio button. The problem with a Yes/No checkbox is that checkboxes accept two values so both boxes could be checked. It also goes against most Users' thinking in that checkboxes usually mean more than one value is acceptable. It's best to use a Radio Button. However, this will work for both checkbox or radio button if the value in your value list is only a 1 (or even a 1 and 0). A single checkbox (or radio) is all that is really needed for form display.

Set Field [ RadioField, Abs(RadioField) < 1]

If [not RadioField]

... do your no script

End If

If [RadioField]

... do your yes script

End If

You can also script yes/no if you wish but it's not as pretty as Abs(). smirk.gif You must be sure your field is EMPTY or only contains 1 or 0 when starting this. This approach is known as a toggle and this same value list can be used for many things - just attach this Value List to your different fields that require it. If you want the word 'Yes' next to it, just resize the checkbox or radio button (ie, 17x17 px) so the text won't show, then place your text next to it. This also allows more freedom in your wording for your selected value.

With only one checkbox (or radio button), you can place text such as, "Apply discount to this order" etc. I admit I use a single checkbox in this way (going against the theory in the first sentence) because I think checkboxes look better than native FM radio buttons.

Link to comment
Share on other sites

Moonshadow,

So I guess if I could use the checkbox method to select both YES & NO if I wanted to activate the AMBIVALENT script?

Thanks for both of your responses.

I will digest them and report back later.

Jarvis

Link to comment
Share on other sites

I think I have it know but I'll try an example in my area...

I have a lesson plan database I created. In it I have the State standards for a particular subject area. Now If I would like to give the user a choice of what state standards to use (ie. NY, NJ, OR, etc) would radio buttons be best (kind of cluttered for 50 states) or a popup menu be better? When their state is clicked either a value list with the right standards would show in the fields or should I have a separate field for each state and use a calculate field to show the standards?

Sorry for being so naive but being new to FMP is exciting but this is the meat and potatoes of the program!!

Thank you

Link to comment
Share on other sites

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