Forum Discussion

ChristineWhite's avatar
ChristineWhite
Qrew Assistant Captain
5 years ago

Button Opens Form and populates parent and child data

I have created a button that opens the new employee table form and pre-populates data from the application table form.  Would it be possible to also pre-populate the associated child records with this same button?

URLRoot() & "db/" & "xxxxxxxxx" & "?a=API_GenAddRecordForm"
& "&_fid_6=" & URLEncode ([Candidate - First Name])
& "&_fid_7=" & URLEncode ([Candidate - Last Name])
& "&_fid_8=" & URLEncode ([Candidate - Email])
& "&z=" & Rurl()

------------------------------
Christine White
------------------------------
  • Yes, you can get this to work with an Automation.

    Add  a line to your code to populate a formula numeric field with the [Record ID#] of the source record in Application.

    Create an Automation triggered by a record being  Created and that field not be blank, and it will have  two steps.

     The first will be to populate a single field in a single record table which is called Application Focus.  This is a table and field which exists with one and only one  to retain the value for a moment of the [Record ID# of the Automation Focus Application].

    You will set up a Relationship where one Application Focus has Many Application Children based on a formula numeric reference  field called [Link to Automation Focus (=1)] with a formula of 1.  The single record table will only have 1 Record so it will be Record ID of 1. Lookup the value of [Record ID# of the Automation Focus Application] down to all Application Children

    Then the Step 2 of the Automation, after setting the Focus Application will be to copy all Application children  to Employee Children where the [Related Application] equals the [Record ID# of the Automation Focus Application].  You will be sure to connect the children to the correct Employee by referring to the Record ID of the Trigger Record.

    Post back if you get stuck.  I have the working in a client application so I can look back if I missed any steps.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • ChristineWhite's avatar
      ChristineWhite
      Qrew Assistant Captain
      Hi Mark,
      Does the Focus Application (Record 1) have both the Application ID AND the new Employee ID?  I am not seeing the connection between the child records and the new employee ID.

      ------------------------------
      Christine White
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        The Trigger Record is the only place which knows Employee Record ID as it is determined when the Employee Record is saved. I believe that when you are setting the fields to copy from the Application Children to Employee Children, that there will be an option to get values from the Trigger Record.   So you need the Record ID of the Trigger Record to populate into Related  Employee so the Employee Children won't be orphans.

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