Value List based on Calculation field not working as expected
I have 3 tables.
Customers: (ID, Name)
Domains: (ID, Name, CustomerID, hasEmail, emailOn)
Emails: (ID, Name, DomainID)
- Customers::ID => Domains::CustomerID
- Domains:ID => Emails:DomainID
- ID (Serial values)
- Name (Text)
- hasEmail (Number - boolean checkbox)
- emailOn (Calculation => If ( hasEmail ; 1; 0 ))
Valuelist "DomainsByCustomerWithEmailOn" setup:
- Use Values from Field
- 1st field "Domains::emailOn", 2nd field "Domains::Name"
- Include only related values starting from "Customers"
Customer Layout setup:
- not editable ID field
- text field for Name
- Tab control for Domains and Email
- Domain Tab has a portal showing textfield for domain name and checkbox for hasEmail
- Emails Tab has portal showing textfield for username and a popup menu on field DomainID using Valuelist DomainsByCustomerWithEmailOn
The Domain Name field on the Email tab will show a popup list containing all the domain names that have the box "hasEmail" checked.
The Domain Name field on the Email shows all domain names associated with a given customer ignoring the "hasEmail" setting completely.
What am I missing?
Looking at the Domains table in Table View (see below) shows that the emailOn calculation works, so why is the valuelist generating a listing of all domain names while being based on that field?