Skip to main content
Question

What is the URL to edit a field, redirect to app homepage, and then display a pop-up message all with one button?

  • October 27, 2015
  • 0 replies
  • 82 views

I already have the URL to edit the field and redirect to the app home page. That was easy and it works perfectly. I just need the extra part to also display a pop-up message.

The URL thus far is as follows:
var bool checkedstate = If([Request Access Modification Field for Notification], false,true);

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord"& "&rid="& [Project ID#]& "&_fid_430="& $checkedstate & "&rdr=" & URLEncode(URLRoot() & "db/bgafau47s")


Separately, I got the following javascript to work on its own in a URL button:
"javascript: alert ('Your Request Has Been Sent. ')"


How do I combine the two elements into one button?
Thanks
This topic has been closed for replies.

I have never been able to combine redirects with JavaScript. I suspect you would need to do it all in java script, but let's see if anyone answers.

If you just want want the edit and a pop up message, I can do that.

  • Author
  • Registered
  • October 27, 2015
I'm fine with just an edit and a pop-up message.  I was under the impression that a redirect of sorts was always required with URL's like this, but if that is not the case, then yes, I would like to see the edit and pop-up.  Thanks

Here is my current best version. This one is setting a checkbox to be checked.

var text URL = URLRoot() & "db/" & "?act=API_EditRecord&_fid_80=1&rid=" &
[Record ID#];
 
"ja ascript:" &
"$.get('" &  
$url &  
"',function(){" &
"$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme:
'jGrowl-green'});" &
"});" &
" oid(0);"

The 5000 means 5 seconds until it fades away. I like this version as it the same green color as the native QuickBase pop ups.

Note that when you do these kind of pop ups, the pop-up will show a success message even if the URL formula completely fails. So it's up to you to be sure that there is no possible way that the URL formula will fail.

  • Author
  • Registered
  • October 27, 2015
Got it.  It works great.  Thanks again.  Actually, I really like that the page does not reload every time I click the button. This lets me click the button for multiple records really fast, and the edits are then still happening in the background even though I can't see it.  Of course, to then see the edits, I would have to reload the page, but this way I can reload the page just one time not each time.

Yes, I totally agree. Sometimes you do want the page refresh but at other times it just slows down the process way too much so it's great to have that tool in your toolkit of quick base tricks.

  • Registered
  • June 15, 2016
Hey Mark, would it be possible to have this notification popup while still having the page reload? I have a case where I need the page to reload because certain fields will be shown after the button is clicked, however I think the popup is a good indicator to have in there as well.

Sorry, I don't know how to both refresh and pop up.

  • Registered
  • May 31, 2018
>I have never been able to combine redirects with JavaScript
>I don't know how to both refresh and pop up.
>Sometimes you do want the page refresh but at other times it just slows down the process

Why not just do it in JavaScript all the time and free your mind from the vagaries of all these special cases and the special handling they require?