Forum Discussion
GeorgeBramhall2
4 years agoQrew Cadet
Hi Mark,
Thanks for the reply!
It comes back saying expecting text (highlighting the & before the Rurl() in the var)
var text refresh = URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z"= & Rurl();
If([Sent Checkbox],
"<a href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=dwh245kc9bvrzfcqkqfwmd876gjx&_fid_35=0"
& $refresh
& "'><img src=\"https://images.quickbase.com/si/16/018-email_unread.png\"></a>","
<a href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=dwh245kc9bvrzfcqkqfwmd876gjx&_fid_35=1"
& $refresh & "'><img src=\"https://images.quickbase.com/si/16/016-email_1.png\"></a>")
------------------------------
George Bramhall
------------------------------
Thanks for the reply!
It comes back saying expecting text (highlighting the & before the Rurl() in the var)
var text refresh = URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z"= & Rurl();
If([Sent Checkbox],
"<a href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=dwh245kc9bvrzfcqkqfwmd876gjx&_fid_35=0"
& $refresh
& "'><img src=\"https://images.quickbase.com/si/16/018-email_unread.png\"></a>","
<a href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=dwh245kc9bvrzfcqkqfwmd876gjx&_fid_35=1"
& $refresh & "'><img src=\"https://images.quickbase.com/si/16/016-email_1.png\"></a>")
------------------------------
George Bramhall
------------------------------
MarkShnier__You
Qrew Legend
4 years agoThat button is actually quite complex. You are trying to present two different hyperlinks, each doing a different URL plus a Page Refresh and two different images. Unless you are a better coder than I am you have no hope of writing it in the syntax you wrote it in.
You really must break it down into pieces. Yes it will be a lot longer formula, but its really just a lot of Copy and Paste.
This tested OK and is easy to read and hence to debug.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
var text UnToggleURL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=dwh245kc9bvrzfcqkqfwmd876gjx"
& "&_fid_35=0";
var text ToggleURL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=dwh245kc9bvrzfcqkqfwmd876gjx"
& "&_fid_35=1";
var text UnToggleRefresh =
$UnToggleURL
& "&rdr=" & URLEncode($RefreshPage);
var text ToggleRefresh =
$ToggleURL
& "&rdr=" & URLEncode($RefreshPage);
var text UnreadImage = "<img src=https://images.quickbase.com/si/16/018-email_unread.png>";
var text ReadImage = "<img src=https://images.quickbase.com/si/24/016-email_0.png>";
var text UnReadHyperlink =
"<a href=" & $UnToggleRefresh & ">" & $UnreadImage & "</a>";
var text ReadHyperlink =
"<a href=" & $ToggleRefresh & ">" & $ReadImage & "</a>";
If([Sent Checkbox], $UnReadHyperlink, $ReadHyperlink)
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
You really must break it down into pieces. Yes it will be a lot longer formula, but its really just a lot of Copy and Paste.
This tested OK and is easy to read and hence to debug.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
var text UnToggleURL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=dwh245kc9bvrzfcqkqfwmd876gjx"
& "&_fid_35=0";
var text ToggleURL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=dwh245kc9bvrzfcqkqfwmd876gjx"
& "&_fid_35=1";
var text UnToggleRefresh =
$UnToggleURL
& "&rdr=" & URLEncode($RefreshPage);
var text ToggleRefresh =
$ToggleURL
& "&rdr=" & URLEncode($RefreshPage);
var text UnreadImage = "<img src=https://images.quickbase.com/si/16/018-email_unread.png>";
var text ReadImage = "<img src=https://images.quickbase.com/si/24/016-email_0.png>";
var text UnReadHyperlink =
"<a href=" & $UnToggleRefresh & ">" & $UnreadImage & "</a>";
var text ReadHyperlink =
"<a href=" & $ToggleRefresh & ">" & $ReadImage & "</a>";
If([Sent Checkbox], $UnReadHyperlink, $ReadHyperlink)
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- GeorgeBramhall24 years agoQrew CadetMark,
You are amazing. I do not think like a programmer so to program like you is a hopeless cause. Your formula is now easy to follow and makes sense to me now that I see it and know that it works. Thank you very much. I will reference this syntax formula for future button attempts.
------------------------------
George Bramhall
------------------------------