Getting related records using of the List function
Using the right relationship between the Dish and Diet tables I want to use the List function to extract by groups (1-Dessert, 2-Lunch, 3-Dessert) the different related Dish records and put them in different fields (Diet::Dessert, Diet::Lunch, Diet::Dinner) so that later on I can put together a diet divided in the following parts: Dessert, Lunch and Dinner.
HOW IT WORKS
1. Through scripting I associate the different Dish records to the current Diet record and they are listed in a portal to the Diet|Dish TO that has two fields:
The name of the dish (Dish::DishName) is added through scripting.
The Diet|Dish::DietPart field is filled by the user and is used to put each dish into one of the following three categories:
2. I have set up a relationship between Dish, Diet|Dish and Diet tables so that only the Dish record with Diet|Dish::DietPart = “1-Dessert” is considered.
3. I have set up the Diet::Dessert field with the List function, based on the relationship mentioned at point 2, to list only the related Dish records that belong to the dessert category.
These are my settings for listing the dishes of the dessert in the Diet::Dessert field:
Dish TO to the Dish table
Diet|Dish TO to the Diet|Dish table
Diet TO to the Diet table
Diet|DishForDessert TO to the Diet|Dish table
DishForDessert TO to the Dish table
Diet|Dish::DishName(text) Lookup from Diet|Dish to Dish
Diet::gDessert (text; global; calculated value, gDessert = “1-Dessert”, calculation result must be Text)
List (Diet|DishForDessert::DishName ); ¶ ; "¶"
Calculation resut is: Text
DishForDessert --< Diet|DishForDessert >-- Diet
DishForDessert::__kp_Dish = Diet|DishForDessert::_kf_Dish
Diet|DishForDessert::DietPart = Diet::gDessert
Sort records by DishName
With the explained setting I don't get any records in the Diet::Dessert field what am I doing wrong?