Forum Discussion

MeredithMoore5's avatar
Qrew Assistant Captain
3 years ago

Buttons, Buttons, Buttons - (new code for all!)

Hello all, 
Sorry I haven't gotten around to putting out some nice code goodies, but today is a new day full of buttons for you. So here you go!

This basic gray button saves your work and then sends you to a code page. - It is good for saving and then a thank you page or you can alter it to go to another form. Just plop it in a Rich Text Formula Field and you are ready to go. Pretty slick.
"<a class='Vibrant Snowy SaveBeforeNavigating' href=''>Save & Logout</a>"​

This next little bit of code really can be used for any link or button, and is a life saver for those of us dealing with the EOTI role.
This is a special encoding that QB can understand. I have it here encoding the Record ID#, but you can use it for any number.
ENCODING: &r=" & QB32Encode( [Record ID#])

URLRoot() & "db/" & [_dbid_table] & "?a=dr&r=" & QB32Encode( [Record ID#])

Have you ever just wanted to click a button and save something as a csv? Yeah, me too. So I did.
This one can take a bit of set up (or not) depending on if you want to download a filtered report or not.
First I make a report (qid=59 in this case), then I make a bunch of "ask the user" filters (V0, V1, V2,...). This would be a filter where you would say, filter by Shirt Size and instead of putting 'equals Red' in the report, you would put 'equals <ask the user>'. Then you would put whatever you were wanting to filter for the report into the code below. This is great for dynamic reports.
But back to the CSV. As you can see on the end, there is '&options=csv'. It really is that easy. Just plop this is a URL Formula Field and make yourself a button.

Looking for an alternative to using the Record ID# in your links / buttons. Yeah, who wants to use the Record ID# when your key field is your email? I sure don't, and I'm just lazy enough to make it work. 
The key is the 'Key' field. Below I have an example of a button that saves what the applicant is working on in one form and then navigates them to edit their parent record by looking up their email. In the parent table, the Key is Applicant Email, so it can use the Applicant Email Address from the child table (the application that they are working on) to find the parent profile record. Just throw this button into a Rich Text Field and you're done.
"<a class='Vibrant Success SaveBeforeNavigating' href='"&URLEncode([Applicant Email Address*])&"&ifv=10'>Edit Applicant Profile</a>"

And last of all, a nice list of the "Vibrant" button set:

    "<a class='Vibrant'>Vibrant</a>", // regular grey button
    "<a class='Vibrant Alert'>Vibrant Alert</a>", // yellowish
    "<a class='Vibrant Danger'>Vibrant Danger</a>",  // red
    "<a class='Vibrant Primary'>Vibrant Primary</a>", // blue
    "<a class='Vibrant Snowy'>Vibrant Snowy</a>",  // white
    "<a class='Vibrant Success'>Vibrant Success</a>" // also blue, but they clain green

Super Secret Bonus Code:
Gradient Background (can be used in buttons and code pages!)
background-image: linear-gradient(220deg, #1e6fb7 50%, #5086b5 80%);

QuickBase Girl