Forum Discussion

DawnRene2's avatar
DawnRene2
Qrew Member
5 years ago

How to add multiple child records to an unsaved parent based on user choice for the number of child records added

Is there a formula URL where I can add multiple child records based on a number chosen by the user before the parent is saved?

I have two tables - Quotes (parent) and Quote Line Items (child). On the Quotes table I have an editable embedded report so they enter quote line items directly on the Quote. On Quotes I also have a field called "# of Line Items." I want the user to choose the number of quote line item child records that they want, click the button and have that save the parent Quote and create the number of child quote line items that they have chosen. No information needs to be brought to the child but the Record ID# and Quote Name.

Thoughts? Thanks!
Dawn

------------------------------
Dawn Rene
------------------------------
  • Dawn
    This can be done but before I weighed in to provide suggestions, why are you asking for this? Why not just let the users enter the child records in Grid Edit mode?  Are you aware that you can add records in Grid Edit mode?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • DawnRene2's avatar
      DawnRene2
      Qrew Member
      I am Mark - the quote line items are in Grid Edit on the Quote form.  Sorry/apologies, I forgot to mention that I have a conditional field for the line item products that is dependent upon a location lookup from the Quote and that does need to be passed down to the child. The conditional field does not work on the Grid Edit as it is a lookup.

      ------------------------------
      Dawn Rene
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Here is a low tech solution which will work for up to 10 children (but really any reasonable number of children).
        Add a new field to the child table called [Child Sequence #]
        Add a new field to the Parent called [# of children to create]
        Lookup the [# of children to create] down to children.

        Create 1 Automation to be triggered when the Parent is added or modified and the # of children to be created has changed.

        There will be 10 Automation steps to create 10 children.  Each will populate the  [Child Sequence #] with a value from 1 to 10.

        Then 11 th step will be to delete any children where the [Child Sequence #] is > the [Child sequence #].   But as a safety net, do not delete any which have any real data.

        The next step can be to filter the embedded report to only show where the [child sequence #] is #  <= [# children to be created] as it will take a couple of seconds for the Automation to run so the user may see extra records before they get deleted.

        I  have not thought through all the next situations where the users needs to add more extra children.




        ​​​​​​

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