AnsweredAssumed Answered

Creating multiple records in related table with found set

Question asked by KevinSalisbury on Nov 3, 2014
Latest reply on Nov 5, 2014 by philmodjunk


Creating multiple records in related table with found set




I've made a table of ingredients for recipes and am now trying to created a related table that would generate an order guide for placing orders with various vendors. Since our menu/ recipes change frequently, my solution is to create a script that would  duplicate the values of a found set ("Active" ingredients on the menu) on the INGREDIENTS table onto new records on the ORDER LIST table. I don't know the syntax for creating such a script, but I think it will involve the following

Enter find mode[]

set field[ INGREDIENT: Status ; "Active"]

Perform find []


        set field [ INGREDIENT: item ; ORDER LIST: item]


This is based on the relationship INGREDIENT: item = ORDER LIST: item, but I guess the tables don't necessarily need to be related if I'm using the set field command. Any pointers?

Also, the order list generated needs to account for ingredients only once. I think this can be done through the find (?) but I'm not really sure. For instance, garlic is used in various recipes but needs to be accounted for only once in the order list . 

Thank you