Forum Discussion

ChrisHesenflow's avatar
ChrisHesenflow
Qrew Member
4 years ago

Conditional Button

I have a button I've created for use in my forms that saves the current record/changes and then exits to the dashboard.

My question is, can I make this button's destination conditional in the sense that I'd like it to return to the dashboard specific to a user's role.  For example my dashboard as Admin may be different than that of a Participant.

Here is my current button code:
"<a style=\"width:310px; text-align: center; background-color: #0274be; color: #fff; padding: 10px; text-decoration: none; font-weight: bold; border-radius: 4px; margin-left: -50px; text-transform: uppercase; \" onclick='DoSaveAdd()' href='https://MY ADMIN DASHBOARD URL'>Save Changes & Exit</a>"


//Saves changes and exits to the dashboard​


Thanks in advance for any insights.

------------------------------
Chris Hesenflow
------------------------------

8 Replies

  • The url below will go to the home page of the app, which then be automatically how the users Role is set.  Does that work for you?

    urlroot() & "db/" & appid()


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • ChrisHesenflow's avatar
      ChrisHesenflow
      Qrew Member
      Thanks, Mark.   And this is where I get screwed up every time with syntax.  How would I place that code into my URL?  (sorry, stupid question, I suppose). As soon as I add in the "db/" with quotations, it throws an extra characters error at me.

      urlroot() & "db/" & appid()

      "<a style=\"width:310px; text-align: center; background-color: #0274be; color: #fff; padding: 10px; text-decoration: none; font-weight: bold; border-radius: 4px; margin-left: -50px; text-transform: uppercase; \" onclick='DoSaveAdd()' href='https://MY ADMIN DASHBOARD URL'>Save Changes & Exit</a>"

      //Saves changes and exits to the dashboard​



      ------------------------------
      Chris Hesenflow
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        try this

        "<a style=\"width:310px; text-align: center; background-color: #0274be; color: #fff; padding: 10px; text-decoration: none; font-weight: bold; border-radius: 4px; margin-left: -50px; text-transform: uppercase; \" onclick='DoSaveAdd()' href=" & URLRoot() & "db/" & AppID() & ">Save Changes & Exit</a>"

        //Saves changes and exits to the dashboard

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