creating a button that references a record in a report link to create a new record in another app

  • 0
  • 1
  • Question
  • Updated 2 weeks ago
  • Answered
I would like to add a button to a form that can create a new record in another app based on a report link on the form. 

The report link has a list of items and information about what condition they are in. If the items are not in satisfactory condition, the user makes a grid edit to the report and selects that, then saves and continues. What I would like to do is have a button appear when that happens that will create a new record in the app where the item information is kept so that they can fill out a discrepancy report for the item.
Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb

Posted 5 months ago

  • 0
  • 1
i may need more information about this but my simple answer is to create a formula URL field in the table where you report link is coming from. Check the box that says show as a button and paste in the URL to "Add Discrepancy Report". You should be able to tell it when to show the button when you write the formula...

Example: In the code below I have a button that toggles on and off when a summary field from my relation is equal to 0 and our turnover date is blank (null).

If([# of records in Planning]=0 and IsNull([Actual Turned Over Date]),URLRoot() & "db/" & [_DBID_PLANNING] & "?a=API_GenAddRecordForm&_fid_16=" & URLEncode ([Record ID#])& "&z=" & Rurl())

Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
Thanks for the reply! I will take a look at that as soon as I get a chance.
Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
I have a button just like that already. The problem I have is that when I change a record via grid edit on a report in another app, I want the button to appear on the form in that other app and I'm not sure how to make that happen.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,664 Points 50k badge 2x thumb
I would like to help but I'm not understanding your question ...
Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
I tried including the field that the button is in on the report, but that doesn't work...

Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
In the form below I would like a button next to the report to appear when I change the status from "satisfactory" to "unsatisfactory" that allows me to create a new record in the app the report originates from. I have that button working in the other app, but have no idea how to create the same thing here.



Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,664 Points 50k badge 2x thumb
You would need to hard code the table code if the table is in a different app.

Can you post the code for the button that is working in the other app , and also let me know the code for the table - all that string of numbers you see in the URL and we can adjust that to work here.

Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
the button:

URLRoot() & "db/" &[_DBID_DISCREPANCIES]& "?a=API_GenAddRecordForm&_fid_7=" & URLEncode([Serial Number])

table code:

bn539nsxk?a=er&rid=13&rl=sdy

and a picture of the table it is on just in case




Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,664 Points 50k badge 2x thumb
try this

URLRoot() & "db/" & "bn539nsxk" & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode([Serial Number])

But I do not know if you have a comparable field for [Serial Number] in the table where you are putting the button.

If you only want to show the button for certain statuses (ie Unstatisfactory), you can use a form rule

Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
There is not a comparable field for [serial number] on the table. The button on the NVG status log will only ever reference one serial number, while on the Flight Rest and Duty log there will always be multiple serial numbers. If I could put the button in the report, that might work but I haven't been successful trying to do so.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,664 Points 50k badge 2x thumb
re: If I could put the button in the report, that might work but I haven't been successful trying to do so.

Why cant't you do the above.
Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
It's primarily a UI thing as you can get to the record fairly easily from the referenced report, but there are a lot of users and it's easy for them to get off-track.
Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
when I put it in the report it showed up as an unclickable url. I'll play with is some more and see if I can get it working.

Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
So, the button works in the report as long as it is on the NVG app, but when I reference it over to the FDR app the button is just text.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,664 Points 50k badge 2x thumb
What do you mean by "It's just text"  What field type is this and if it is a URL formula type did you specify a label for the button?
Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
The field is a report link referencing the NVG app NVG status table where the button resides. When I look at a report including the URL field for the button on the NVG status app it works correctly.


Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
but when I use it in a report link it is just text


Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
When I click on the link in the Flight Duty and Rest table Quickbase says it is a report field and that it is not editable.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,664 Points 50k badge 2x thumb
I'm not understanding the issue well enough from the screen shots to understand the issue.  Can you post a zoomed in screen shot of just the embedded repor in that last screen shot.
Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
Sure thing. Where it says Create New Discrepancy in the embedded report is the problem. If I look at that report in the NVG app that field is a Formula URL field which displays as a button and works correctly. Once I embed it, it no longer works.




Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 64,658 Points 50k badge 2x thumb
Are you trying to push a button while in Grid Edit Mode?  Is that embedded report in the screen shot in Grid Edit Mode.  If so then you cannot have a button in Grid Edit mode.

The best you could do is to have a similar report not in Grid edit mode on the form where the user can push a button there.  So have similar report twice on the same form, one goes into Grid Edit mode and one does not.  In View mode only one would show.
Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
That is an excellent idea. All of the users are generally in edit mode using this form. I didn't realize grid edit mode would make the button not work. Thanks!
Photo of Dante Tognoli

Dante Tognoli

  • 620 Points 500 badge 2x thumb
Okay one last question (about this specific topic). Is there a way to hide the button in the embedded report if the status is set to unsatisfactory?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,664 Points 50k badge 2x thumb
Sure, just edit the code for the button like this

IF([Status] = "Unsatisfactory", .... insert button formula here)

I’m not sure if you want the button to appear when the status is equal unsatisfactory or the opposite, but the idea is to wrap the formula with an IF.