Automatic Show and Hide of Fields
Last updated 20/12/2021
How Five Hides and Shows Related Fields
With the relationship established at the table-level, Five will automatically remove the foreign key field when the form is in the stack.
Example
In the below example the Vendor table has a foreign relationship with the Catalog table. A vendor can have many catalogs.
At the form-level, a form is made for both of the tables. The Catalogs form holds the VendorKey field and the field is required to have a value.
Scenario One
A menu item is created to reference the Catalogs form. The Catalogs form is at the top-level so the foreign key field VendorKey is available on the form allowing you to select the vendor who the catalog belongs.
Scenario Two
The Catalogs form has no menu item created and is attached as a list page on the Vendors form. Navigating to the Catalogs sub-form on the Vendors form, the foreign key field VendorKey is not visible on the Catalogs form. Five automatically removes the field in this scenario as the vendor involved is already known.
Scenario Three
The Vendors menu item is the parent menu for the Catalogs form. This will require you to select a vendor and drill down to the Catalogs form. Five automatically removes the field in this scenario as the vendor involved is already known.