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.

Script help

Featured Replies

  • Newbies

Novice user. Trying to write what is probably a basic script, but I am sooooooo confused.

What I would like to do is return a price in a separate field (in the same layout, for now) when conditions are satisfied in two popup fields. These are both text fields, colors in one, sizes in the other(such as 38x97.5). Can someone help me out with a sample, or point me to the best help site for a beginner? Thanks very much

HI:

Welcome to the Forum.

Take a look at the attached sample. Let us know if you need more assistance.

In this example the prices are set up for 'Red' & 'S' and 'Blue' &'P'

I'm sorry, you did say script. The example is a simple calculated field. I'll do a script as well and repost.

********************************

Here's the one with the script.

hth

Price.zip

Price2.zip

Edited by Guest

you did say script. The example is a simple calculated field.

I believe a lookup from a Prices table would be the correct method to use here.

Yep, but he said it was all in the same table. I assumed he just wanted to see how to formulate things and it would not be how he is building his app. At least I hope he isn't. :

Hi

I learning to use FMP 8.5 so I often look at questions and answers at this site, which offers great help-thanks for that.

I have downloaded the above two files from aldipalo, but I am unable to view the script.

Should I be able to or is it supposed to be hidden?

Script maker is “greyed out” although Calculate Price is available (not greyed out)

Also if I press the New record button I get a message: “This action cannot be performed because the file is not modifiable”

Thanks

The New Record button does not have a script attached. It directly calls a Script STEP of New Record.

It sounds like the file has become read-only.

  • Author
  • Newbies

Thanks for your quick response...I think what you posted will help and I will also research the "lookup" in someone else's comment. Would it be difficult for you to post an example of that?

Thanks again,

durban1

Here's the file again. I also added a related inventory table that enters the price based on your color and size choice. The files are definitely not set to 'Read Only' on my side. Let me know if you are having a problem with it. If so, send me a private message with your email address and I'll send the unzipped file directly to you.

hth

Price3.zip

I don't think that's quite right. I would suggest something like this:

PriceBySize.fp7.zip

I can not disagree. If he is looking for an invoicing solution your example is excellent. I was just answering his basic questions.

  • Author
  • Newbies

Thanks to all for your excellent help. Unfortunately the file you attached is "unmodifiable". Is there another way to send it?

You're on windows by the sound of it - pull it out of the opened zip file say onto your desktop, everything is perfectly open, when it lives on it's own.

--sd

  • Author
  • Newbies

Thanks again for your patience and prompt replys. I unzipped the file per your directions and it looks like this will be very much in line with what I can use. A couple of questions. In the size field, how can I change the format from "S,M,L,XL" you used to actual dimensions, such as "38.75 x 99". I'm sure it is simple but I can't figure it out. Also, will that affect related fields. Also, can I change indexed fields to popup fields (as the occasional field has many choices) and will that affect the way the fields relate. I have sent for a manual, and I'm sure it will all come together over time, but it is all brand new to me. Finally, in the price list, for instance, can I insert another parameter, if needed, and will THAT affect relations. Thanks again for your help.

I not sure I understand the 38.75 X 99. Does that mean the price is $38.95 X 99 units = $3,856.05?

If yes I would suggest you have 2 fields. NumberofUnits and PriceperUnit. You would then set up two separate value lists and set your calculation to 'Price = PriceperUnit * NumberofUnits.

On the other hand if you are talking about rolls of fabric and you have a roll of 38.75 X 99 and another roll of 25.75 X 56 you can just replace those values in your value list.

If the field has MANY choices you probably would want a Drop Down list rather than a pop up. But, yes you can change it if you wish.

What you put into a field will not affect the relationship. In this example I am using Color and size to determine the price. If you were to add Yellow to the color list then the price would be determined if you had a yellow 'Color' and a S 'Size in inventory.

To change the value list go to:

File>Manage>ValueList>Size

Then click Edit and then add your values. Remember you can also develop your list using a field from a related table.

I hope this helps you. If you have any other questions let us know.

BTW, I am assuming you are referring to my file not Comments. It is best to reply to the person you wish to ask the question of if there are multiple and differing answers so there's no confusion which answer you want to expand upon.

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.