Calculated Field with dinamic dropdown

Hello
I’m sorry but I am new in the forum and I’m just starting to use suiteCRM
I have a Dropdown List named Food with two selections Fruit - Vegetables
where value is F and the Label is Fruit
the parent dropdown is Fruit and ovbiously i make a dropdown like this
F_Orange
F_Apple
F_Pear

The dynamic dropdown work, but I need to associate to every fruit a value to use in the formula of the calculated field.
I need to make a calculated field that takes the value of the selected fruit
What is the formula to give a value to every selected fruit and be this value taken for the calcuted field?
Can someone tell me the correct sintax of the parent dropdown and how to make the calculated field?

Hi Bertol, i think is more simple if you create your logic hooks to do this operation…

logic hooks doc

:wink:

Another way is to use the Calculated fields in workflow if you don’t wish to do any code.

Have a look at the documentation on using Calculated fields as actions when something is saved.
Documentation: Calculated Fields

Thank You

Here’s the syntax of how I made the dinamic dropdown :
F_Orange[Orange]
F_Pear[Pear]
F_Apple[Apple]

I have to give the values
150 to Pear
50 to Apple
200 to Orange
to use them as parameters of the calculated field.

I don’t know the correct syntax.
How do I build the dropdown so that it gives me back the parameters?

Thank you

What kind of logic hook should I use?

You should use the Module Hooks.
You can use one or more of them, depends when you want to start the calculation and what you want to do with this value.

hello

I would like to include in the construction of the workflow the cost of the products chosen by the dropdown (fruit in this case), so that I can take the cost and multiply it

I write this in previous post
hank You

Here’s the syntax of how I made the dinamic dropdown :
F_Orange[Orange]
F_Pear[Pear]
F_Apple[Apple]

I have to give the values
150 to Pear
50 to Apple
200 to Orange
to use them as parameters of the calculated field.

I don’t know the correct syntax.
How do I build the dropdown so that it gives me back the parameters?