Why won't my drop-down field auto-fill?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I have a form linking two tables that has a couple lookup fields. These lookup fields autofill when a a specific drop-down field is filled. This form can also be accessed via a "add new" button when you click on a record in a different table. When you click on the "add new" button, all the fields autofill with the information of the record that you came into the form from, except for the drop-down field. That stays blank, and when you press save, the autofilled information is not saved, despite being visible in the form. 

Why won't my drop-down field autofill when the form is accessed through the record that the drop-down menu is supposed to select?

Photo of Matthew

Matthew

  • 0 Points

Posted 4 years ago

  • 0
  • 1
Photo of Xavier Fan

Xavier Fan, Champion

  • 370 Points 250 badge 2x thumb
Can you give some details as to what that drop-down field is?  Is it a reference field for the parent table?  (which would make sense for what you said about:  " These lookup fields autofill when a a specific drop-down field is filled.")

And also the nature of the "autofilled" information - are these lookup fields?  Or fields that are autofilled using form rules, default values, etc.
Photo of Matthew

Matthew

  • 0 Points
The autofilled fields are all lookup fields.

The dropdown field is the reference proxy for the "details table." The link to the details table form is found on each master table record. Master table information fills all the "details table" lookup fields, and I'm trying to get the reference field (dropdown field) to autofill as well.

Right now, because the dropdown reference proxy field is not autofilling, the record is getting saved with blanks in all the lookup fields.

Sorry for the confusion. I hope that clarifies. And thank you!
Photo of Xavier Fan

Xavier Fan, Champion

  • 370 Points 250 badge 2x thumb
Ok - if I understand you correctly:  from the parent record (the "master table record"), you're adding a child record (the "details" record"), and you want the parent record to be pre-filled already in the new child record.

Please post the formula for the Add button.  Normally - when you add a new relationship - the Add button already has parameters in there to fill in the "Related Parent".  We want to make sure that's happening in this case.

Also - we will need to know what the reference field is from the Details up to the Master - usually it's the Record ID# of the parent, called something like [Related Parent].
Photo of Matthew

Matthew

  • 0 Points
Yes! And the reference field from details up to the Master is [Related Parent].

The add button formula:

URLRoot() & "db/" & [_DBID_(child table)] & "?a=API_GenAddRecordForm&_fid_11=" & URLEncode ([Record ID#])& "&z=" & Rurl()
Photo of Xavier Fan

Xavier Fan, Champion

  • 370 Points 250 badge 2x thumb
Ok - go to your details table (child table), and into the Settings > Fields.

On the upper right, click on "Advanced Options", and check "Field Id".

Then check what the Field Id is for [Related Parent].

If the Add button was already working correctly, the Field Id would be 11.

URLRoot() & "db/" & [_DBID_(child table)] & "?a=API_GenAddRecordForm&_fid_11=" & URLEncode ([Record ID#])& "&z=" & Rurl()


That's what the bolded part in the Add button formula above is doing - filling in the field with Field ID = 11 - with the Record ID of the current record on the Parent table.  This in effect sets the reference field (and also reference proxy, and all the other lookup fields) to the correct related Parent recod.


However - if the Field Id of [Related Parent] is NOT 11, this won't work.  So you'd need to update "&_fid_11" to match the Field Id of [Related Parent], whatever it is - 17, 21, etc.
Photo of Matthew

Matthew

  • 0 Points
Thank you! I had copied the formula from another add button I had made, and assumed the two child tables were similar enough that those numbers would be the same. Apparently, I had one field fewer in this table; the 11 should have been a 10.
Photo of Xavier Fan

Xavier Fan, Champion

  • 370 Points 250 badge 2x thumb
Ok great!