Forum Discussion

JimHarrison's avatar
JimHarrison
Qrew Champion
4 years ago

Rich Text - Formula Fields are pretty nice.

This is fantastic! That underlined bit down there all appears to be functional. Note the OpenAsPopup must be first, if SaveBeforeNavigating precedes, it doesn't work.

Rich Text - Formula field example:

var text btnName = "+ Child Records";
var text url = URLRoot() & "db/" & Dbid() & "?a=showpage&pageID=34#" &[Record ID#]&"&"&[Related Records]);
var text style = [styleAdd];
var text title = "Add Record Button";
//*****DO NOT EDIT BELOW THIS LINE*****
//HTML
"<a class='Vibrant Success OpenAsPopup' data-height=600 data-width=600 class='SaveBeforeNavigating' data-refresh=true title=\"" & $title & "\"style =\"" & $style & "\"" & $target & "href=" & $url & ">" & $btnName & "</a>"

[styleAdd] is a Quickbase variable in the App Properties so you can style all the buttons in all the tables in all the forms once. 

Here's the variable:
display: block; width: 130px; text-decoration: none; text-align: center; padding: 8px; font-size: 12px; color: #ffffff; border-width: 1px; border-color: #777777; border-style: none; border-radius: 3px; background-color: #6BBD57;
It makes a green button just like a QB button but in a form.

Imagine a Button on a form, Form properties have the "alternate name" = blank.
Fields on the form can be changed before clicking the button (no more Save & Keep Working!!! No more losing changes!!!).
When the button is clicked, the code page loads in a 600X600 popup window and the code runs (not in a browser tab!!!).
When the code is complete, a JavaScript alert in the code page prompts the User the code is done and closes the popup window.
When the popup window closes the Form saves and reloads!!!

Example:
A checklist table with a generic checklist.
A new record that needs a checklist. The checklist added to the new record is related to the record and therefore its own checklist.  The checklist is not "related" to the generic checklist table. The benefit of this process means changes to the record-checklist will not affect the generic checklist records nor other checklist records.

All I need to figure out now is how to style the js alert() so it is consistent with qb alerts.

Thanks Quickbase! These class changes have given Users much better flow to their daily processes.


------------------------------
Jim Harrison
transparency = knowledge + understanding : The Scrum Dudes
------------------------------
  • Thanks Jim, this is great! A couple of questions:

    1. Where is the [StyleAdd] variable you mentioned? I am not seeing it?
    2. If you use DataRefresh=True without also SaveBeforeNavigating, will it lose any changes?
    3. Do you have a code page that automatically closes the popup window?

    ------------------------------
    Mike Tamoush
    ------------------------------
    • JimHarrison's avatar
      JimHarrison
      Qrew Champion
      1. Where is the [StyleAdd] variable you mentioned? I am not seeing it?
      Look up Quickbase Variables in the Quickbase documentation.

      2. If you use DataRefresh=True without also SaveBeforeNavigating, will it lose any changes?
      Good question, I didn't test. Curious to know the results of your testing.

      3. Do you have a code page that automatically closes the popup window?
      No, we use a JavaScript alert() with an "All Done" message which then does a window.close; when "Ok" is clicked.

      ------------------------------
      Jim Harrison
      transparency = knowledge + understanding : The Scrum Dudes
      ------------------------------
      • MichaelTamoush's avatar
        MichaelTamoush
        Qrew Captain
        Would you be willing to share your JavaScript Alert 'All Done' code page? Not sure if it's something proprietary you keep for your company or not.

        ------------------------------
        Mike Tamoush
        ------------------------------