Skip to main content
Solved

Adding If Statement to URL Formula

  • October 10, 2019
  • 0 replies
  • 108 views

Hey all,
I wanted to know if anybody knows how to add an if statement to a URL formula with javascript?

Currently my formula looks like this:

var text url=URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&_fid_30=Sent&_fid_29=Sent&apptoken=XXXXX&rid=" & [Record ID#];

var text ifStatement=If([Submitted for Payroll Log] != "Sent" and [Commission for Homeowner] != 0, $url, " ");

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

Everything is working great except for the button is showing up still when the parameters: [Submitted for Payroll Log] != "Sent" and [Commission for Homeowner] != 0 are met when it shouldn't be.

------------------------------
Amanda
------------------------------

Best answer by MarkShnierYou

np
var text url=URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&_fid_30=Sent&_fid_29=Sent&apptoken=XXXXX&rid=" & [Record ID#];

If([Submitted for Payroll Log] != "Sent" and [Commission for Homeowner] != 0,

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

) //this is the closing bracket to the IF


------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
markshnier2@gmail.com
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • Answer
  • October 10, 2019
np
var text url=URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&_fid_30=Sent&_fid_29=Sent&apptoken=XXXXX&rid=" & [Record ID#];

If([Submitted for Payroll Log] != "Sent" and [Commission for Homeowner] != 0,

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

) //this is the closing bracket to the IF


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