2 Replies Latest reply on Sep 25, 2014 3:02 PM by Steve_2

    recipe list confusion



      recipe list confusion


      I've managed to horribly confuse myself….how do I create a method to input and then display ingredients in a recipe database? (Without inputting all the ingredients for one recipe in a single field. In part so I can create different layouts with varied orders and formatting.) I've got input fields for: Imperial Quantity, Imperial Measure, Metric Quantity, Metric Measure, and Ingredient. Obviously, some recipes will have more ingredients than others. Exactly how do I create this? And if a portal is the solution, how does one set this up for input, and with what relationships? Once a recipe is input, one will want to be able to search it by name, and always have all the ingredients appear in the correct order; and also have the ability to change/add/delete ingredients.  Thanks everyone!

        • 1. Re: recipe list confusion

          Start with these relationships:


          Recipes::__pkRecipeID = Recipe_Ingredient::_fkRecipeID
          Ingredients::__pkIngredientID = Recipe_Ingredient::_fkIngredientID

          You can place a portal to Recipe_Ingredient on the Recipes layout to list and select  Ingredient records for each given Recipe record. Fields from Ingredients can be included in the Portal to show additional info about each selected Ingredient record and the _fkIngredientID field can be set up with a value list for selecting Ingredients records by their ID field. Fields in Recipe_Ingredient would record the quantities needed to produce one unit of the Recipe.

          You can then set up a list view layout base on Recipe-Ingredient where you put the fields from Recipe in the header, footer and/or a grand summary layout part, with fields from Recipe_Ingredient and Ingredients placed in the body.

          You'd use a script with perform find or Go To Related records to pull up all of recipe_ingredient records for a given recipe as a way to print out the ingredients for any given recipe. (And a variation of this can list multiple recipes and their ingredients.)

          This is a many to many relationship with Recipe_Ingredient set up as the "join" table.

          • 2. Re: recipe list confusion

            Thanks! I think I've set it up a bit differently based on my needs, based on how your explanation clarified how to set up the relationships. Much appreciated.