6 Replies Latest reply on Dec 5, 2013 8:18 AM by philmodjunk

    Scripting down a tree

    RichNasser

      Title

      Scripting down a tree

      Post

           Good Morning:

           I am at a loss having tried for days to script an action that would take a part code and go down the BOM tree until it reaches the final child item while multiplying the quantities along the way.  So a simple example:

           If Part A has 2 components B and C, and requires 2 of B and 3 of C

           Part       Component  Qty

           A                   B             2

           A                  C               3

           Then my output needs to have 2 lines multiplying the # of A items to be made by the amount of B items and C items.  If B or C have children of their own, the script has to continue down the tree multiplying along the way.

            

           I've tried For loops comparing Part numbers to Child numbers, then I've tried Perform Finds instead of looping.  I get stuck when I need to recur  and save variables for the multiplication.  I am attaching my Recipe_Ingredient table as an example.


           Thanks

      Screen_Shot_2013-12-04_at_9.13.06_AM.png