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 set 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 bypasses 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
------------------------------
  • EricMohlman's avatar
    EricMohlman
    Quickbase Staff
    I taught how to do that specific thing at our Empower user conference this year.

    The recording from the session can be found here: https://university.quickbase.com/empower2019-course/342287 and the application I taught from exists in the Exchange here:https://team.quickbase.com/db/main?a=AppDetail&ID=3795&app_name=EMPOWER2019:%20Advanced%20Formulas (replace your account URL instead of the team.quickbase.com portion)

    Here's the formula I utilize in that session:

    URLRoot() &

      "db/" &

      Dbid() &

      "?a=API_EditRecord&apptoken=c3f3znbrgaavayvp95cc53c2fs&rid=" &

      [Record ID#] &

      "&_fid_9=Rejected&_fid_20=" &

      Now() &

      "&_fid_40=" & UserToEmail([Approver]) &

      "&rdr=" &

        URLEncode(

          URLRoot() &

          "db/" &

          Dbid() &

          "?a=er&rid=" &

          [Record ID#] &

          "&dfid=12&nextURL=" &

          URLEncode(

            URLRoot() &

            "db/" &

            AppID()

          )

        )

    ------------------------------
    Eric Mohlman
    ------------------------------
  • Endy,

    What is the architecture?   Does this describe your app?



    Assuming that Related Object Status =1  is Declined
    Change your button to a GenAddForm and pass into it the value
    "&_fid_X=1"   where X is the Field ID of the Related Status.

    On the form for the Object Status Change put the Related Object Status in a hidden section and require the field Reason in order to Save the form.

    Your User will be in "Edit Mode" on the form from the beginning of their user experience.

    Make sure you redirect back to the parent record with a 
    "&z=" & Rurl() at the end of your URL string.



    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------