Forum Discussion

EndyLu's avatar
EndyLu
Qrew Trainee
5 years ago

Button that can change a field and then go to edit mode

I have a declined button where when you press it, the status will be changed to declined. However, I put in a rule where a status cant be declined without a decline reason. Currently, when the button is pressed it will bypass my rule.  Is there any way I can make my button change the status to declined and then go to edit mode, so I can choose a decline reason?

------------------------------
Endy Lu
------------------------------

4 Replies

  • Can you post the code for your button and then I will add the extra code to land the user in edit mode?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------
    • EndyLu's avatar
      EndyLu
      Qrew Trainee
      sure thing, this is my code

      var text Declined = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=dghxdxrc9kgh4qbn746c7dje9wds&rid="&[Record ID#]&"&_fid_6=Declined";

      "javascript:{"&
      "fetch('"& $declined &"');"&
      "location.reload('"& $Declined &"');"&
      "}"

      ------------------------------
      Endy Lu
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        Try this. The only issue will be where you want to land the user after the record is saved. 

        var text Declined = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=dghxdxrc9kgh4qbn746c7dje9wds&rid="&[Record ID#]&"&_fid_6=Declined";

        var text EditMode = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#];

        $Declined
        & "&rdr=" & URLEncode($EditMode)

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