Forum Discussion

AudreyBenenati's avatar
AudreyBenenati
Qrew Cadet
6 years ago

Adding a related child record with a button

​​Hi, This seems really basic but I can't find any instructions on how to do this.

I have a form that shows a parent record and all the child records related to it. 

I have a button to add new child records.

The button does not populate any info to tie the new child record to its parent. It lets the user pick from a drop down.

I do not want the user to pick. I want the parent record's info to be populated automatically and immediately on the child form.

Please help. Thanks!

------------------------------
Audrey
------------------------------
  • When a new relationship is created, the default [Add...] button will be programmed to populate the related reference field value with the parent-key field (usually Record ID#) value.  The related reference field, often displayed on the child-record form, will only show the 1st-field in the record picker, set in the Parent-table.  If your record picker first-field value does not have any data; this can be confusing and look like it is not connected to anything.

    The related reference field is still selectable; and can be changed, which is probably why it looks like it is not populating.

    If you have a Proxy Field in your relationship; you cannot put both the Related Reference AND the Proxy field on the form in Add/Edit modes because they conflict with each other.

    Can you post an image of what you Add-Child-Form looks like with the Related Reference or Proxy field visible?

    ------------------------------
    Laura Thacker (IDS)
    laura@intelligentdbs.com
    (626) 771 0454
    ------------------------------
    • AudreyBenenati's avatar
      AudreyBenenati
      Qrew Cadet
      ​When I click the button on the parent record, it brings me to the child table's form, without the parent record info populated (there is a whole section of fields that should be populated on the child form, but they're all blank).

      This new forum format is not allowing me to upload or paste any images.



      ------------------------------
      Audrey
      ------------------------------
      • LauraThacker's avatar
        LauraThacker
        Qrew Captain
        Can you post your formula...

        ------------------------------
        Laura Thacker (IDS)
        laura@intelligentdbs.com
        (626) 771 0454
        ------------------------------
    • AudreyBenenati's avatar
      AudreyBenenati
      Qrew Cadet
      ​Here is the formula for the button field.

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

      ------------------------------
      Audrey
      ------------------------------
      • LauraThacker's avatar
        LauraThacker
        Qrew Captain
        Audrey,
        There is nothing wrong with your formula; as long as FID 16 is the [Related Reference Field] joining the two tables.
        Probably you are not seeing the record picker show a valid entry, or you have both the Related Reference field and a Proxy field on the form.
        I suggest you call me today; so we can resolve via a screenshare for you.
        Laura

        ------------------------------
        Laura Thacker (IDS)
        laura@intelligentdbs.com
        (626) 771 0454
        ------------------------------