"Depends On" in a new field

Dear all,

I’m not sure what changed, but some times ago I created a lots of new fields in the item form.
All these fields had condition on the “Depends On” part… like
eval:doc.item_group==“Fertiliser”
or
eval:doc.item_group==“Fungicide”||eval:doc.item_group==“Insecticide”

Now I noticed that these fields (which I only wanted to show for these specific item_group are being displayed regardless of the item_group.

I did change the item_group tree a while back where I have put all these item_group under a new parent.

Any advice on how to repair that?

Thanks in advance,

François

I don’t think it is related to the changes in item group tree.

I can check an error in your example code: eval:doc.item_group=="Fungicide"||eval:doc.item_group=="Insecticide"

This should be like below:

eval:((doc.item_group=="Fungicide") || (doc.item_group=="Insecticide"))
5 Likes

Thanks Nabin.
Are you sure, because I got this from:

Any way I’ve tried your solution as well, It seems like both options works.
Now, what is weird is that first it didn’t change anything, then 10 minutes laters, all the changes took effect.

How can that be? Is this a cache issue (I’m on Chrome)? Or something to do with the server that render the page (I’m on frappecloud)?

The code is same as rmehta suggested, just enclosed them inside bracket.

I have tested the same in my local system and it works.

How can we show a field depending on whether the parent field has a value. To be specific, value of more than 0, then the child table should become visible…?

Thank you.

eval:doc.field_name != null

3 Likes

Figured it while ago, thanks anyways :slight_smile:

good to know. Please concider marking this thread as solved. Thank you.

1 Like

How can i link a field (check box) located in a different section break and the depends on field in different section break ?

eval:doc.custom_do_you_hav_previou_experience==Yes; if the dropdown custom_do_you_hav_previou_experience have valu yes then this field need to show this is not working
Screenshot 2023-10-10 151022

Screenshot 2023-10-10 151328
external_work_history; this is the field that need to show when yes is clicked on dropdown