Skip to main content
Question

Help with URL Button to Trigger Checkbox & Dynamic Rules

  • August 3, 2021
  • 0 replies
  • 44 views

Hi,

I'm trying to make a fancy "to-do" list (simplified for sake of discussion) and have hit a snag.

I had set up some Dynamic Rules to have a Checkbox log a Date/Time field to the current timestamp.
This works only in "Edit" mode of a form.

I wanted this to be easier on the user and tried using a URL Button that when clicked (in View mode) would check the Checkbox field for them. However, when this happens, it doesn't look like it's triggering the Dynamic Form rule of also logging the timestamp.


var text AffectedCheckbox = "&_fid_195";

var text URL= URLRoot() & "db/" & Dbid() & "?act=API_EditRecord"
& "&rid=" & URLEncode ([Record ID#])
& $AffectedCheckbox & "=1"
& "&apptoken=" & "(my app token)";

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

Also, I read that javascript reload isn't good as QB will remove it for security reasons later on in the year, but I wasn't able to find an alternative that worked in these discussions.

Thank you for any help.



------------------------------
Brian
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
Dynamic form rules will only kick in when a human user is editing a record in the browser.  The form rules run on the browser.  Try this code. Change the 999 to the fid of the date time field.


var text URL= URLRoot() & "db/" & Dbid() & "?act=API_EditRecord"
& "&rid=" & URLEncode ([Record ID#])
& "&_fid_195=1"
& "&_fid_999=now"
& "&apptoken=" & "(my app token)";

var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();

$URL
& "&rdr=" & URLEncode($RefreshPage)


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