Expand all | Collapse all

Need help adding multiple children conditionally

  • 1.  Need help adding multiple children conditionally

    Posted 12-20-2018 12:43
    Hello. I currently have a setup where Requests < Tests. I have a 3rd Methods table which has 2 fields: "Test Name" and "Test Category".

    In the Requests page, I would like people to input their sample information and select the "Test Category" from a drop-down. Based on this field, I am trying to limit the choices of their "Test Names" in the Tests table. I cannot figure out a way to allow them to enter multiple tests with the conditional implementation. I tried a few things already but nothing seems great.

    Idea 1) I tried a grid-edit embedded report. I made an automation to generate 10 blank related Tests when a report is created but it takes a lot of steps: Create the Request, save, reload after automation, edit Record, select Test Name from dropdown on blank children, and save. This is obviously not ideal. I'm trying to get AJAX scrolling enabled which may help by only loading the embedded report after the automation has run.

    Idea 2) The other idea I had was to create one connected table per Test Category and use dynamic form rules to bring up the correct Multi-Select Text field. Then when everything is saved run a looping automation to create the child records. This is pretty messy and requires a lot of overhead but is WAY more user friendly.

    Can someone please let me know if there is a better way to accomplish this?

  • 2.  RE: Need help adding multiple children conditionally

    Posted 12-20-2018 14:49
    It seems to me that this should be a simple Conditional Drop Down (CDD) setup. Nothing fancy and no Automations.

    As you Add child record Tests to the Request  the child record can know from a lookup field from Requests what the user has selected for the Test Category (or preferably bring down the [Related Test Category] and call it [Record ID# of Test category] ) down on the test record. 

    Then set up the CDD to filter the choices for the tests based on the [Record ID# of Test category] matching the [Related Test Category].

  • 3.  RE: Need help adding multiple children conditionally

    Posted 12-20-2018 15:57
    Hey thanks for replying. It's not as simple as it appears. If users were expected to click "Add New Test" it would be very simple because the parent record would save and the child would be created with the CDD.

    I however want my users to use one form to add the child records all at once, then save. This can be 10+ children all with different [Test Names]. The complexity lies in the fact that when you create a new parent record, it doesn't immediately create a [Record ID#] or the parent [Test Category] until you save. In addition, using a grid-edit embedded report, doesn't drop the [Test Category] to the child record until that child record is created itself. You would have to add a field (let's say [Test#]) to initialize the child record before the CDD would work. If the child is not initialized first QB throws a "This Field is dependent" error. Thus I would have to instruct my users to fill out the sample information, save, edit, add child in grid-edit using the [Test#] as the first field. I don't want them to have to save then edit.

  • 4.  RE: Need help adding multiple children conditionally

    Posted 12-20-2018 17:06
    OK, i did not know that the data entry method was Grid Edit.

    I think a decent workflow would be to have the user create the request and select the test category and save,

    Then the user would click a button to ADD tests.  That button would have a URL to add 10 records.  (I can help you with that but its just somethng like this.

    & "&rdr=" & URLEncode($ADDADD )
    & URLEncode("&rdr=" & URLEncode($ADDADDURLThree))
    & URLEncode(URLEncode("&rdr=" & URLEncode($ADDADDURLFour)))
    & URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($ADDADDURLFive))))
    & URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($ADDADDURLSix)))))
    & URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($ADDADDURLSeven))))))
    & URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($ADD)))))))
    & URLENcode(URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($ADDURLNine))))))))
    & URLENcode(URLENcode(URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($ADDURLTen)))))))))
    & URLENcode(URLENcode(URLENcode(URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($EDIT))))))))))

    So the URL will add 10 records and then edit the parent record.

    Then you can have an Automation run maybe when a child is saved but was blank for the test, so delete those unneeded of the 10 records.

  • 5.  RE: Need help adding multiple children conditionally

    Posted 12-20-2018 17:38
    Is it possible to chain that url together with a save? So at the bottom of the edit mode you can click a button, it creates the Request, adds the blank children, then moves you back into edit with the blank children?

    Alternatively, I had mentioned a Multi-Select Field. I could've set it to trigger an automation and fill in the child records without secondary intervention. Is it possible to restrict the list?

  • 6.  RE: Need help adding multiple children conditionally

    Posted 12-20-2018 17:43
    That URL for $ADD will need to link the children to the parent.  The parent needs to exist to know the Record ID#, so you do need to save the parent first.

    I'm not really understanding your proposed solution with a Multi-select field.  The choices in a multi select field cannot be limited like a CDD does.

  • 7.  RE: Need help adding multiple children conditionally

    Posted 12-20-2018 17:56
    Alright I'll give that a shot. So if I had a conditional Multi-Select field [List] I would:
    Make a number field: [i]=1
    Make a formula text field: [Test_i]=Part(ToText([List]),[Counter],";")
    Trigger an automation to do the following:
    1) Create related child i
    2) Copy parent [Test_i] to child [Test]
    3) In parent, [i]=[i]+1
    4) Repeat if [Test_i] is not blank

  • 8.  RE: Need help adding multiple children conditionally

    Posted 12-20-2018 18:00
    re: So if I had a conditional Multi-Select field [List] 

    i don't think that there is a such a thing as a conditional Multi-Select field [List]