Skip to main content
Question

Button to open Code Page and pass record data to Code Page

  • February 12, 2021
  • 0 replies
  • 92 views

AdamKeever1
Forum|alt.badge.img+2
Button to open Code Page and pass record data to Code Page

Can anyone share a method to do this? I have a custom form that works great for creating new records. I want to be able to give the users the ability to then view that record in the same format that they entered the record. I know this is possible with javascript, but is this possible without javascript?

------------------------------
Adam Keever
------------------------------
This topic has been closed for replies.

QuickBaseJunkie
Forum|alt.badge.img+15
Here you go! I plan to make a video on this topic soon. 

This particular formula/code page passes a URL to display a specific form to a pop-up print window, then returns the user to the page they were on.

This would replace the 'onclick' use in a rich text formula field. Additional parameters (name=value) can be passed they just need to be separated with a "&".

FORMULA - URL:
URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=17" & // code page
"&url=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=printr&dfid=10&rid=" & [Record ID#])//passed to code page for print window

CODE PAGE:
<!DOCTYPE html>
<html>
<head>
<script>
var urlParams = new URLSearchParams(window.location.search);
var url = urlParams.get('url');
var referrer = document.referrer;
window.open(url,'Print','width=800,height=700');
window.location.replace(referrer);
</script>
</head>
</html>

Let me know if this works for you 👍

------------------------------
Sharon Faust (QuickBaseJunkie.com)
Founder, Quick Base Junkie
https://quickbasejunkie.com
------------------------------