Forum Discussion
- ChayceDuncan2Qrew CadetYou might try doing a url encode on the rdr. Also looks like you've got an extra single quote and space in the secondary url between the rdr= and http that should be removed
So ... your string would end with:
[Record ID#] & "&rdr=" & URLEncode("https://...") & "'>Click Here...
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base - QuickBaseCoachDQrew CaptainJoey,
If you post your code we can correct it. It's really hard to read or correct a screen shot. - ZintJosephQrew CaptainOk, what Chayce provided above worked except I need to pass the Record ID in the redirect URL
This is what I tried but is giving me an error
"<a href='https://my.quickbase.com/db/xxxxxx?act=API_EditRecord&usertoken=my_user_token&apptoken=my_ap...; & URLEncode("https://my.quickbase.com/db/xxxxxx?a=showpage&pageID=53"&[Record ID#]&")&"'>Click Here To Decline</a>"
Basically this redirect is taking me to a page to enter a reason of Decline and that is entered on the record...this is the need to pass the RID in the redirect - QuickBaseCoachDQrew CaptainWhat is on that page?? 53
- ZintJosephQrew Captain
This is the code in the redirect page....you enter a reason of decline and that gets posted back to the record, that is why I need to pickup the record ID in the redirect
<form name=qdbform method=POST onsubmit='return validateForm(this)' encType='multipart/form-data' action=https://my.quickbase.com/db/xxxxx?act=API_EditRecord&usertoken=my_user_token&apptoken=my_app...;
<input type=hidden name=fform value=1>
<center><table>
<center>Billing Review Declined Reason</center>
<tr><td class=m><textarea name=_fid_207 rows=6 cols=60></textarea></td></tr>
</table><input type=hidden name=rdr value='https://my.quickbase.com/db/xxxxxx?a=dbpage&pageID=53'></center>;
<input type='hidden' name='rid' id='rid'/>
<center><input type=submit value=Save></center>
</form>
<script lang="javascript">
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
}
function getUrlParam(parameter){
var urlparameter = '';
if(window.location.href.indexOf(parameter) > -1){
urlparameter = getUrlVars()[parameter];
}
return urlparameter;
}
var recordId= getUrlParam('rid');
var ridElement = document.getElementById('rid');
ridElement.value = recordId;
function CheckForOther (item, origlen)
{
var sitem = item.options[item.selectedIndex];
if (item.selectedIndex == (item.length - 1))
{
var val = prompt ("ADD A NEW CHOICE:", "");
if (val == null)
item.selectedIndex = 0;
else
{
var slen = item.length;
if (slen == origlen+1){
item.options[slen] = new Option (sitem.text, sitem.value);
}
item.options[item.length-2].text = val;
item.options[item.length-2].value = val;
item.selectedIndex = item.length-2;
}
}
}
</script>
<script lang=javascript>
function validateForm(theForm)
{
}
</script> - ChayceDuncan2Qrew CadetIf you're intent on using a code page - looks like your window.location parsing is missing something. You need to actually split out the parameter using a "&" and parameter name like below
So your actual redirect link would be like realm.quickbase.com/db/dbid?a=dbpage&pageid=2&recordid=12345
and then grab the window.location and grab the value that appears after your recordid parameter.
Another option using standard quick base if you're just trying to grab a secondary user entry is to set up a secondary quick base form that only has those fields on there. So instead of redirecting to a script page you could redirect to a form like:
realm.quickbase.com/db/dbid?a=er&rid=12335&dfid=10
Where dfid=10 is an alternate Quick base form in that table with just those fields on it
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base - ZintJosephQrew CaptainThis is all working in another app, the difference between this app and that one is how the code for the redirect is being done. So how do I add the Record ID to this
URLEncode("https://my.quickbase.com/db/xxxxxx?a=showpage&pageID=53"&[RecordID#]&")&"'>Click Here To Decline</a>" - ChayceDuncan2Qrew CadetThe URL would look like this in my experience-
"https://my.quickbase.com/db/xxxxxx?a=showpage&pageID=53&rid=" & [Record ID#]
The &rid= after 53 is what I added - ZintJosephQrew CaptainYeah, that is not working either, it is not passing the rid to the redirect page. I am not figuring out why it works in my other app but not here other than how the redirect url is coded between the two.
- ZintJosephQrew CaptainJust wanted to follow up and let you know that I got it working....one little mistake
On the URL redirect I have showpage&pageID instead of dbpage&pageID
From this
https://my.quickbase.com/db/xxxxxxx?a=showpage&pageID=53&rid="&[RecordID]&...;
To this
https://my.quickbase.com/db/xxxxxxx?a=dbpage&pageID=53&rid="&[RecordID]&...;