Forum Discussion
AhuvaBrown
5 years agoQrew Cadet
I'd suggest using an if-statement to determine which checkbox to check each time the button is pressed. If none of the boxes are checked, follow URL1, if the first box is checked, URL2, etc.
if([checkbox 1] = false, URL1, [checkbox 1] = true and [checkbox 2] = false, URL2...
------------------------------
A Brown
------------------------------
if([checkbox 1] = false, URL1, [checkbox 1] = true and [checkbox 2] = false, URL2...
------------------------------
A Brown
------------------------------
LizChartrand
5 years agoQrew Cadet
Absolutely,
I was missing a few pieces in fact -
The following ended up working:
//step 1 initial QB update check box checked
var text URLONE =
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=[]" &
"&_fid_82=" & URLEncode(UserToName(User())) &
"&_fid_77=true" &
"&rdr=" &
URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]);
//step 2 CRT complete check box checked
var text URLTWO=
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=[]" &
"&_fid_82=" & URLEncode(UserToName(User())) &
"&_fid_80=true" &
"&rdr=" &
URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]);
var text FIRSTURL =
$URLONE;
var text SECONDURL =
$URLTWO;
If(
[QB Update Complete?]=false and
[CRT completed?]=false,
"<a class='Vibrant Primary' style='border:1px solid #ffffff; background-color:#6BBD57'" & "a href=" & $FIRSTURL & ">Units Updated</a>",
If([QB Update Complete?]=true and
[CRT completed?]=false,
"<a class='Vibrant Primary' style='border:1px solid #ffffff; background-color:#6BBD57'" & "a href=" & $SECONDURL & ">Lease Execution Completed</a>",
If([QB Update Complete?]=true and
[CRT completed?]=true,
"<a class='Vibrant Alert' style='border:1px solid #ffffff; background-color:#6BBD57'>Completed</a>"
)))
Thank you for your help!
------------------------------
Liz Chartrand
------------------------------
I was missing a few pieces in fact -
The following ended up working:
//step 1 initial QB update check box checked
var text URLONE =
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=[]" &
"&_fid_82=" & URLEncode(UserToName(User())) &
"&_fid_77=true" &
"&rdr=" &
URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]);
//step 2 CRT complete check box checked
var text URLTWO=
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=[]" &
"&_fid_82=" & URLEncode(UserToName(User())) &
"&_fid_80=true" &
"&rdr=" &
URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]);
var text FIRSTURL =
$URLONE;
var text SECONDURL =
$URLTWO;
If(
[QB Update Complete?]=false and
[CRT completed?]=false,
"<a class='Vibrant Primary' style='border:1px solid #ffffff; background-color:#6BBD57'" & "a href=" & $FIRSTURL & ">Units Updated</a>",
If([QB Update Complete?]=true and
[CRT completed?]=false,
"<a class='Vibrant Primary' style='border:1px solid #ffffff; background-color:#6BBD57'" & "a href=" & $SECONDURL & ">Lease Execution Completed</a>",
If([QB Update Complete?]=true and
[CRT completed?]=true,
"<a class='Vibrant Alert' style='border:1px solid #ffffff; background-color:#6BBD57'>Completed</a>"
)))
Thank you for your help!
------------------------------
Liz Chartrand
------------------------------