Skip to main content
Question

conditional dropdown with add a record - populate child field from parent

  • March 26, 2018
  • 0 replies
  • 73 views

Forum|alt.badge.img+7
I have two tables - company and contact.  One company (parent) has many contacts (child).

I create a company.  Then click Add a contact.  The contact  form opens in another window - but the company field (showing what parent it is under) is not populated.

a) why does the form open in another window?

b) how can I automatically get the company field to populate with the company the contact is being added to?
This topic has been closed for replies.

Are you using the button automatically created when you created the relationship? If it opens in a new window, it's because you have "Open Target in New Window" selected in the options portion of the field properties. The parent should always populate. You need to check the formula. Feel free to add the formula in your post.

Forum|alt.badge.img+7
  • Author
  • Registered
  • March 26, 2018
yes, I'm using the button.

It has this:

URLRoot() & "db/" & [_DBID_CONTACTS] & "?a=API_GenAddRecordForm&_fid_39=" & URLEncode ([Record ID#])& "&z=" & Rurl()

It seems that when I save the parent first, then click on Add Contact, it works properly.  I have
"Save parent record automatically when a child record is created" checked on both tables (because sometimes I'm wanting to create a Company from another table/ parent record).  So it's acting like it doesn't actually save the Company (parent record) before trying to add the child.

And it doesn't actually connect the two - the contact is saved, with no company.

You have the target set to open in a new window. Remove that option and it will work. I just tested it on one of my apps.

Forum|alt.badge.img+7
  • Author
  • Registered
  • March 27, 2018
Yes, I see that now.  That one is fixed.

Here is another version of this same problem, with a different setup from a programmer's POV, but the same in the Users eyes. It works differently.

Suppose I start with an Activity, which has a related Company and Contact.

On the Add Activity form I have a conditional dropdown so that I can only see the contacts related to the company if I pick the company first.  That works great.

Now, suppose the company doesn't exist yet.

I have more than 1000 companies, so QuickBase forces the company picker.  The user does browse, doesn't see it, and clicks Add Company from within the picker window.  The company can be added.   Now, when the user picks Add Contact at this point from the button at the bottom of the Add Company form, QuickBase closes the Add Company window and returns to Add Activity.  You can't use the "Add Contact" button from the Add Company form when you get to it through the picker.

And, since the Contact dropdown in  the Add Activities form is conditional on the Company, there are no Contacts in the dropdown list.  If you try to Add a contact, you can do it, but you have to go back and choose the new company you just added.

Is there a way I can tell it that the contact I'm adding should be connected to the company i just added. It seems to lose the company when adding a contact, if I got to the company through the picker.

The picker.... is picky.