Discussions

Expand all | Collapse all

Creating multiple child records based on the quantity of a field in the parent table

  • 1.  Creating multiple child records based on the quantity of a field in the parent table

    Posted 23 days ago
    Hi,

    Is it possible to create multiple child records automatically based off of a quantity field in the parent table?

    For example - A new parent record is created and the Order quantity field in the parent record is 25. I would need 25 new child records created.

    Second nice to have feature would be that each new record has a component number assigned from 1-25.

    ------------------------------
    Allison Corriveau
    ------------------------------


  • 2.  RE: Creating multiple child records based on the quantity of a field in the parent table

    Posted 23 days ago
    There are many ways to do this and its not clear from your post if you want the user to click a button to make this happen or if the children should be created when the Parent is first saved.

    One no code solution is to use an Automation to run a save table to table import.

    The setup will be to create a table called Focus Parent with a single record in it.  It will be Record ID# = 1.  There needs to be one numeric field called [Record ID# of Focus Parent] and also a numeric field for the [# of Children needed].

    Then make a table of records called Future Children numbered from 1 to say 1,000 - whatever the highest number of children you would ever need created.  Import a set of records from Excel, and include a field for [Child Number]. 

    Then make a relationship between Focus Parent and  Future Children based on a formula numeric field called [Link to Focus Parent (=1)].  Make that be a formula field equal to 1.  Look up the ​value for the [Record ID# of Focus Parent] and [# of Children needed].

    Next make a save table to table copy from Future children to the Parent's child table.  Set the field mapping to assign the field for Related Parent to the [Record ID# of Focus Parent] and and include the  [Child Number] so the children will come in numbered.  Limit the filer on the records to where the [Child Number] is less than or equal to the  [# of Children].

    Lastly, decide what will trigger the Automation. For example you might want them created when the Parent is created or edited, and the [# of children needed] is >0​ but the Parent has no children yet (base that off a summary field).

    The Automation steps would be to 
    1. Edit the Focus Parent record to set the  [Record ID# of Focus Parent] and [# of Children needed].
    2. Run the saved table to table import.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Creating multiple child records based on the quantity of a field in the parent table

    Posted 23 days ago
    Allison,

    Do you have Pipelines?   

    There is supposed to be a For Next loop in that.   It would solve your issue if you can put a loop around your quantity field.

    Quick Base is rolling out now but I have only seen the webinar.    As soon as I get a hold of it, this is the first feature I am going to test.


    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------