Dynamically Display a report in parent table from child table

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
I have a parent table X and a child table Y. I am trying to fetch a report from child table Y when the user selects a particular value in parent table X. Based on the value selected in X by user I need to dynamically display the report from Y (filtered by value selected by user). Can someone please help me? Thanks!
Photo of Akanksha Grover

Akanksha Grover

  • 70 Points

Posted 1 year ago

  • 0
  • 1
Hi Akanksha, you could set up different forms with each of the reports you want to be able to display, then put a Formula URL button on your main form that dynamically chooses which form to display based on the value selected in X. Your users would then just need to 'press the button to display the report'.

var number FORMID = Case([X Value],"AAA",6,"BBB",7,"CCC",8,"DDD",9,1);

URLEncode(URLRoot() & "db/" & Dbid() & 
"?a=er&dfid="& $FORMID &
"&rid="& [Record ID#])

You'll just need to update the Case formula with your field and values for both the value selected in X and the ID numbers from you different forms. Also, don't forget to select "Display as a button".
I suggest a simple lookup field for the parent to the child.  Then edit the report used for that embedded report on the parent to include a filter for that selection.  You will need to save before the filter takes effect, so I suggest suppressing that report in Edit mode as it will confuse users.