Forum Discussion

JimHarrison's avatar
JimHarrison
Qrew Champion
4 years ago

Example of SaveBeforeNavigating

Just came by to say it's verking! I am filled with so many happy's.

"Builders can now use a new CSS class (SaveBeforeNavigating) inside of a formula-rich text field so that Quickbase saves the record before navigating when this setting is used.

Note that only one of the above workflow classes is supported per formula-rich text."

Example code of a button:

var text btnName = If(Contains([Egnyte_Link_Text],""),"", If([Email Payroll Trigger],"Email Sent","Send Dispatch to Payroll"));
//URL
var text urlOne = If(Contains([Egnyte_Link_Text],""),"",If([Email Payroll Trigger], URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#]) & "&apptoken=&_fid_369=0&_fid_370=\"\"" & "&z=" & Rurl(), URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#]) & "&apptoken=&_fid_369=1&_fid_370=" & Today() & "&z=" & Rurl()));
var text urlTwo = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & URLEncode([Record ID#]);
var text url = $urlOne & "&rdr=" & URLEncode($urlTwo);
//Style
var text style = If(Contains([Egnyte_Link_Text],""),[styleGrey], If([Email Payroll Trigger], [styleGrey],[styleEdit]));
//Target
var bool popup = false;
var text target = If($popup = true, "target = _Blank ", "");
var text title = "Click button to send Dispatch to Payroll";
//*****DO NOT EDIT BELOW THIS LINE*****
//HTML
"<a class='SaveBeforeNavigating' title=\"" & $title & "\"style =\"" & $style & "\"" & $target & "href=" & $url & ">" & $btnName & "</a>"
//Syntax end


------------------------------
Jim Harrison
transparency = knowledge + understanding : The Scrum Dudes
------------------------------

8 Replies

  • Jim,

    The other thing they implemented was 'Openaspopup'. I cannot get this to work. Have you tried, and if so do you know the syntax to add it? I tried 'class=Openaspopup' but that didn't work.... tried target='openaspopup' and that just opens it in a new window.

    I'm trying to figure out the syntax, and even better, if we can control the size of the pop up

    ------------------------------
    Mike Tamoush
    ------------------------------
    • JimHarrison's avatar
      JimHarrison
      Qrew Champion
      Hi Mike,

      Have you tried syntax (class='OpenAsPopup')? **note single quotes placement and case is camel caps, everything in parenthesis.
      I have not tried it yet. My guess is the pop-up cannot be styled "yet" and that we would need that as a parameter of the class.

      See if you can get it to work. I'll mess around with it tomorrow maybe.

      Good Luck,
      Jim

      ------------------------------
      Jim Harrison
      transparency = knowledge + understanding : The Scrum Dudes
      ------------------------------
      • MichaelTamoush's avatar
        MichaelTamoush
        Qrew Captain
        Got it working thanks to Justin Torrence who posted on a different thread.

        var text URL = URLRoot() & .............

        "<a href=\"" &url & "\" class=\"OpenAsPopup\">Words Here</a>"

        I will admit, I don't know CSS very well and I typically have different syntax, so am a little unclear as to how I could modify this in different cases (ie, I typically use <a href='" & $URL & "'>Words here</a>" and I don't know how to add it with that syntax, but Justins worked!)

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