Multiple Depends On conditions for a field

All,

Is there a way to test multiple conditions in the “Depends On” value within Customize Form?

For example I want to only show the field sales_order_item.size if the following two conditions are true:

sales_order_item.group != ‘Services’

and

sales_order_item.item_code != ‘Test’

So I added a Depends on saying:

eval:doc.item_group!=‘Services’ and eval:doc.item_code!=‘Test’

I also tried:

eval:doc.item_group!=‘Services’ and doc.item_code!=‘Test’

but neither works and result in me not being able to edit the Sales Order Item lines at all :frowning:

Is this possible and if so, what is the syntax to do it?

Thanks.

1 Like

Try this

eval:(doc.item_group!=“Services” && doc.item_code!=“Test”)

5 Likes

Thankyou @mehta_akshay is there an SQL “IN” or “INLIST” equivalent to further shorten the syntax or am I stuck with multiple &&s in all my statements if I want to add even more Depends On?

eval:!in_list([“Services”, “Test”], doc.item_group)

10 Likes

@nabinhait brilliant thankyou!