Dbone
September 28, 2016, 8:25pm
1
I’m trying to make a custom field in the Quotation doctype where the visibility depends on what’s in the item child table.
I would like the field to show if any items in the item child table have an item_group value of “Optional”.
Is this possible? Any help would be appreciated.
@Dbone use this in depends_on
eval: cur_frm.doc.items && cur_frm.doc.items.length && in_list(cur_frm.doc.items.map(function(r){ return r.item_group}), "Optional")
4 Likes
Dbone
September 29, 2016, 3:43pm
3
Unfortunately this doesn’t work. Custom field is always visible even with no items in the child table.
Dbone
September 29, 2016, 5:14pm
5
This time the field is hidden and won’t un-hide if an item from the group “Optional” is shown. Using the script also prevents me from saving the document.
Dbone
September 29, 2016, 5:48pm
7
Haha, might have figured that out myself if I looked at it more carefully!
Works beautifully, thank you very much for your help!