Mark,
Your button work nicely, but I like to control the button a bit more. My button works if the parent rid is available and fails when the parent is not yet established.
// Begin button style
var text bgcolor = "#F1948A";
var text txtcolor = "black";
var text style = "style=\"text-decoration: none; width: 100px; text-align: center; background:" & $bgcolor & "; border-radius: 5px; padding: 5px 0px; color: " & $txtcolor & "; display: inline-block; font: normal 700 28px/1 \"Calibri\", sans-serif; text-shadow: none;";
// End button style
var text rid = If([Record ID#]>0, ToText([Record ID#]), "%%rid%%");
var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid;
// Mark's snippet
//"<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "'>Save & Keep Working - Rich Text</a>"
// My update
"<a " & $style &"'SaveBeforeNavigating' data-replaceRid=true href='" & $url & "'>Save & Keep Working - Rich Text</a>"