How do I create a URL button on a QB Form that saves the current record and then displays a report?

  • 2
  • 2
  • Question
  • Updated 11 months ago
  • Answered

Our team frequently works by looking up a record, editing that record, and then looking up the next record.

They start by using a look-up report (Prompt the user for a Record #, for example.)

Currently, they must return to the Home page, or the report list to re-run the look-up report.

I'd like to add a URL button to the native QuickBase form which saves the current record; and then runs the look-up report.

I'm not seeing a way to do this with a single click.

If we click the report button, we are prompted to save the record -- which is OK, but not ideal.

Ideally, I would like to click one button and do both steps.

What ideas / suggestions do you have?

Thank you in advance for your help.

- David in Tucson
Photo of David_In_Tucson

David_In_Tucson

  • 216 Points 100 badge 2x thumb

Posted 3 years ago

  • 2
  • 2
Photo of Dinesh

Dinesh

  • 484 Points 250 badge 2x thumb
David,

I guess this is not possible OOB in QuickBase form since QuickBase always calls the Save dialog before redirecting to the mentioned URL. However, there is a long way to achieve using Image onload by pasting the following code in the Image Onload script.

$("a:contains('<button text')").off('click').on('click',function(){$("#dialogLinkAway").hide();LinkAwayNo();DoSave()})


Here the <button text> needs to be replaced with the actual text that you want to show in the button. In the button formula, you just need to place a space character.
Photo of Gaurav Sharma

Gaurav Sharma

  • 6,024 Points 5k badge 2x thumb
Helpful :)
Photo of David_In_Tucson

David_In_Tucson

  • 216 Points 100 badge 2x thumb
Thank you Dinesh.

We implemented the 2-step process and kept going.  

When I get to experiment I'll try this suggestion.

- David
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
David, not tested, but maybe there is a simple solution using nexturl to make customized EDIT button.

var text URLONE = urlroot() & "db/" & dbid() & "?a=er& rid=" & ToText(Record ID#])
var text URLTWO = urlroot() & "db/" & dbid() & "?a=q&qid=xx"

$URLONE
& "&nexturl=" & urlencode($URLTWO)
Photo of Kelly

Kelly

  • 1,812 Points 1k badge 2x thumb
This works on desktop for me, but doesn't seem to work in mobile. 
Photo of Paul Vorster

Paul Vorster

  • 586 Points 500 badge 2x thumb
HI Kelly, did you manage to get a solution for mobile, as I have the same problem?
Photo of Kelly

Kelly

  • 1,812 Points 1k badge 2x thumb
No, sorry, I did not. You might just want to add a line of text to instruct users to save and then add their child records.
Photo of David_In_Tucson

David_In_Tucson

  • 216 Points 100 badge 2x thumb
Hi Mark,

I'm sorry, I'm not following.

If I'm reading this correctly, URLONE is a link to edit the record.
URLTWO is a link to display a report

I can't find anything about nexturl in the help.  Is this a parameter for URL calls, or simply the name of the variable you defined in your example.

I'm interested and not quite following.

Would this button be on the original report?  
- when clicked open the record for editing and then go back to the report when saved?


Thank you for your help.

- David
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
I'm expecting that you would put this button on your report that you want to return to - which is the one with the <ask the user> question.  You might even suppress the regular edit button on the report and put in this as a little button as the first column of the report.

The "&nexturl=" part is undocumented but it seems to work in all the situations I have used it on so far.
Photo of David_In_Tucson

David_In_Tucson

  • 216 Points 100 badge 2x thumb
Thank you Mark.  I'll experiment with it and let you know what I find. - David