How do I link to a specific form on the child record from the embedded report on the parent record?

  • 1
  • 2
  • Question
  • Updated 1 year ago
  • Answered

I have two tables: Products (parent) and Inventory Adjustments (child). Inventory adjustments has multiple forms used for different purposes instead of having one main default form. How do I get the embedded report to link to a particular form when viewing or editing?

Here's an example of the above:

I've created two inventory adjustments. "Order" and "Sale." Both appear on the embedded report on the products table. When I click on "order" I want it to take me to the "order" form. When I click on "sale" I want it to take me to the "sale" form.

Is this possible?

Photo of Andrea

Andrea

  • 90 Points 75 badge 2x thumb

Posted 3 years ago

  • 1
  • 2
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,542 Points 50k badge 2x thumb
yes, its possible.

Make your own URL button to display the correct form and suppress the native view button.

The formula for the URL button would be like

var text FormID = IF([Transaction Type] = "Sale", "2","10");

urlroot() & "db/" & dbid() &"?a=dr&rid=" & ToText(Record ID#]) & "&dfid=" & $FormID

In the example above, the formula variable is identifying the type of transaction and you will get the form ID# by looking at the form tab in settings for the table to see the form ID#.



I suggest labeling the button "View" and not showing it as a button.

If you also need an edit button, then make a duplicate of that field but change the a=dr (action = display record) instead to a=er (action = edit record)

To suppress the existing View and Edit buttons and use your own buttons instead, you will need to go into your Parent form, and look for the blue link to the report you have used for the embedded report- click though that to get to the report and edit it to add in your two new buttons as the first two columns and at the bottom uncheck the allow users to View and allow users to Edit, as you will instead be adding those two fields you just made as the first two columns of the report.
Photo of Jim Harrison

Jim Harrison

  • 1,926 Points 1k badge 2x thumb
One correction and one enhancement.
Code is missing a bracket at ToText([Record ID#])
Also to return to the originating record after clicking Save & Close instead of the default form include the last part below. 
URLRoot() & "db/" & Dbid() &"?a=er&rid=" & ToText([Record ID#]) & "&dfid=x"& "&z=" & Rurl()

Oh and thanks this is awesome!
(Edited)
Photo of Jim Harrison

Jim Harrison

  • 1,926 Points 1k badge 2x thumb
Also suggest opening the View button in new window. View doesn't know how to go back to the originating form - there's no Save & Close. A User is more apt to close a window if its a pop-up but not foolproof.

Additionally if the User edits the record from the View button pop-up, Close & Save takes User back to Default form, which is weird. What we really want is the form to maintain its dfid throughout the process. 
 
A workaround: make the View button display a form that is not editable.  
Photo of Andrea

Andrea

  • 90 Points 75 badge 2x thumb
Thank you!! This is exactly what I was looking for.