Extra fields Visibility

Good afternoon everybody,
I created two extra fields for the products form.
The first is “Product Type” with attribute code “tippro”. Field type = Radio buttons with two values “Inverter” or “Accumulation”
The second is “Inverter type” with attribute code “tipinv”. Field type Radio buttons.

Now I would like to make sure that if the user chooses the “Inverter” item as the product type, the “Inverter type” field is shown.

If in the “Visibility” field I insert this code ($object->ref==zc1?1:0) where zc1 is the product reference it works but if I try with this code
($object->tippro==Inverter?1:0) doesn’t work.
How do I access the value of the “tippro” variable of the extra field?

Thank you
Mirko

Hello,

Have you tried
($object->option_tippro==Inverter?1:0)

Yes, but don’t work.

I tried also($object->options_tippro==Inverter?1:0) and don’t work.

see Attachment

Hello,

My bad, it should be :
($object->array_options["options_tippro"]?1:0)

:joy: don’t work!

I tried also

($object->array_options[‘options_tippro’]==Inverter?1:0)

But nothing!, it doesn’t work

Can you print screen the “tippro” extrafield configuration ?

yes!. attached are the screens of the tippro fields

($object->array_options["options_tippro"]=="Inverter"?1:0)

I enter the string with double quotes. save it. When I reopen it the double quotes have been removed

What is your Dolibarr version?

dolibarr version 16.0.4

I see that I have the same on my V16.0.5…

Try simple quote seems to work :
($object->array_options['options_tippro']=='Inverter'?1:0)

@mirko

Have you try the code that from ksar ?
Because i have same issue with this . And that code doesn’t work for me .

Yes, I tried it and it doesn’t work for me also