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

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

Recommended Posts

Posted

I have a program that has calculations that require scripts to activate them.

Example:

"select_rate" script

If["rate_code = "4"]

Perform script[sub-script, "rate_misc_1"]

Halt script

End If

If["rate_code = "5"]

Perform script[sub-script, "rate_misc_2"]

Halt script

End If

I have about 20 of these if statements running in the "select_rate" script

"rate_misc_1" script

Enter browse Mode

set field ["rate_misc_1", "price *.10"]

rate_code is a calculation that states if the name of the rate is "name", then use this Code #.

Example:

Rate = "10% Min 100", 2

Rate = "10% Misc", 4

and so on.

The rate_code is based on a value list I have setup with all the names of the rates.

My question is this:

Do I have this setup right, or is there an easier way to achieve a value from a rate_code that is matched up with the price of the product? confused.gif

Any help on this would be appreicated.

Posted

Why do you need a script for this? Have you considered using just a plain calc field that references the rate?

You could store your rates in a related file through the relationship ratename::ratename

and then your calc field could be

price*ratename::rate

To keep your figures from changing in the event you will alter rates at some later date, you could define a lookup rate field in your master file and use this as a reference in your calc field.

HTH

-Raz

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