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.

If function based on Layout

Featured Replies

I'm pretty new to FMP. Is there a way to create a script based on the layout your in? An example would be I have several tables (all with layouts created for them) that all have a New button on them, based on which layout you're coming from I would like to choose which new screen to go to. Hopefully, I'm explaining that right.

  • Author

aholtzapfel clued me in to use Get(layoutname). Thanks again.

Yes, you can do If Get(LayoutName) = "blah"

Or, you can make use of script paramaters.

Have each button perform the same script but just send a different paramater each time.

I actually suggest using Script Paramaters as much as you can. Once you really get used to them, you can find all kinds of great uses for them.

  • Author

Hey there ZT! Thanks for the info. Could you give me a little more on how I can use the script parameters? Would I need to then have a separate script for each button passing the parameter then running the universal script or could it be combined into one large script?

If most of your script steps are the same except for what layout you are going to bring the user to, then use one script with a different script parameter attached to each button calling the script.

Then in your script just have an If statement that brings you to a certain layout based off your Script Parameter.

  • Author

I don't mean to sound dumb, but I guess I am in this area. How can I attach a parameter to the button? I know I could use the first line of the script to set variable then run the script based on that variable, but that would mean creating multiple scripts and that's what I was trying to prevent. Am I just missing something?

when you asign your script to your button you will find a field at the bottom of the window that will allow you to enter a script parameter

Phil

  • Author

Thanks Phil. Would you believe me if I said I never (well, never being over the last month) noticed that before. Can you tell I still have a lot to learn and my boss wants me to be the sole FMP developer for our company. Lucky for me, and everyone at our company, our main database runs on progress.

Sarah

Edited by Guest

No probs. I am still learning myself so I know the feeling only too well.

The people in here are really helpful though - and patient thank goodness

Regards

Phil

  • Author

I was so glad when I stumbled upon this site yesterday looking for help on the internet. I felt like I was never going to get anything accomplished because I had been working on the same problem all of last week. It's hard without a support group, but thanks to you all I feel like I have one now. Thanks again Phil, John and ZT for all you help and hopefully you all won't get tired of me and my questions too quickly.

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.