Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

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

Posted (edited)

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
Posted

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. :

Posted

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

Posted

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

  • Newbies
Posted

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

Posted

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

  • Newbies
Posted

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

Posted

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

  • Newbies
Posted

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.

Posted

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.

This topic is 6052 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
×
×
  • Create New...

Important Information

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