Forum Discussion

PaulPeterson1's avatar
PaulPeterson1
Qrew Assistant Captain
5 years ago

URL Formula not working as needed

I have a checkbox that will conditionally check several other checkboxes when checked.  I am trying to add a button from to perform this action and am using the check and reload from the Magic Buttons app.  

The automations and form rules are working as desired when I check and uncheck the checkbox.  But when I use the button I have several issues:
  • not all of the checkboxes are checked using the button
  • any checkboxes that were checked since the previous save are not saved
  • when I try to save I get an error page stating that someone else is editing the record

Please review the code below and let me know what I am missing/doing wrong:

var text urlyes =
    URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=##&rid=" & [Record ID#] & "&_fid_3134=1";
var text urlno =
    URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=##&rid=" & [Record ID#] & "&_fid_3134=0";
var text notSubmitted = "<a style=\" text-decoration: none; background: #D7D4D3; border-radius: 5px; color: #000; display: inline-block; width: 190px; text-align: center; padding: 8px 20px; font: normal 700 10px/1 \"Calibri\", sans-serif; text-shadow: none; \" href=\"javascript:" & "$.get('" & $urlyes &
    "',function(){" & "location.reload();" & "});" &
    "void(0);\">MS Services Not Submitted</a>";

var text allSubmitted = "<a style=\" text-decoration: none; background: #008000; border-radius: 5px; color: #fff; display: inline-block; width: 190px; text-align: center; padding: 8px 20px; font: normal 700 10px/1 \"Calibri\", sans-serif; text-shadow: none; href=\"javascript:" & "$.get('" & $urlno &
    "',function(){" & "location.reload();" & "});" &
    "void(0);\">MS All Services Submitted</a>";

If(not [Submit All], $notSubmitted, $allSubmitted)​

(app token removed for security purposes)

------------------------------
Paul Peterson
------------------------------
  • URL formula buttons will only work in View mode.  Are you in View mode or Edit / Add Mode on the record when you push the button?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • PaulPeterson1's avatar
      PaulPeterson1
      Qrew Assistant Captain
      I think you just pointed out my issue.  I was in fact in edit mode.  I didn't realize buttons only worked in view.  I have a few other buttons that are functioning as expected when in edit mode.

      ------------------------------
      Paul Peterson
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        It's not so much that they don't work in edit mode, it's more than you navigate away from the screen before saving any edits.  There may be some code out there somewhere which will save before executing the edit, but code that I have that I thought worked, just SAID it saved but did not really save,

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