Filter lookup field by a condition declared in a deluge script using a value of another field

Filter lookup field by a condition declared in a deluge script using a value of another field

Hi, im trying to filter a lookup field, the idea is to use deluge to filter the options shown in a lookup field.

Is this possible ?

For example, I only want to show in my lookup field the products that are “red”. And the color preference is defined in another field of the same form.