Skip to main content
Question

Need Help With First Button Attempt

  • March 23, 2020
  • 0 replies
  • 38 views

As stated before, I just started working in Quick Base and I'm having trouble with my first attempt at a button.  The label is showing, but not as a button.  I am trying to check an checkbox and update a status field when the button is pressed.  The conditions in the if statement are validating the form data to ensure that at least one service is on the order, that all of the subscribed services are verified and that there are no reported issues.  I am guessing there are multiple issues, please be kind.

var text URLAPPROVE = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&_fid_274=1";

var text URLCOMPLETE = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&_fid_18=Completed";

var text URLCOMPLETEISSUES = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&_fid_18=Completed With Issues";

If([Has Service] and [Is Verified] and [NoIssues],$URLAPPROVE & URLEncode($URLCOMPLETE) & Rurl(),
If([Has Service] and [Is Verified] and not [NoIssues], $URLAPPROVE & URLEncode($URLCOMPLETEISSUES) & Rurl()))

I would also like to know how to include the code below to return to the previous location after the button is pressed:

"javascript:" & "$.get('" & $url & "', function(){" & "location.reload();" &
"});" & "void(0);"

------------------------------
Paul Peterson
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • March 23, 2020
You should not be editing the same record twice or you will not be able to refresh to the page as easily,

So calculate the URL like

var text URLAPPROVECOMPLETE = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &

"&rid=" & [Record ID#] &
"&_fid_18=Completed"
"&_fid_274=1";


var text URLAPPROVECOMPLETEISSUES = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&_fid_18=Completed With Issues"
"&_fid_274=1";


var text URL =If(
[Has Service] and [Is Verified] and [NoIssues],$URLAPPROVECOMPLETE,
[Has Service] and [Is Verified] and not [NoIssues], $URLAPPROVECOMPLETEISSUES)


"javascript:" & "$.get('" & $url & "', function(){" & "location.reload();" &
"});" & "void(0);"





------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------