Discussions

 View Only
  • 1.  Rich Text Field - Save Before Navigating

    Posted 12-02-2021 11:36
    I have a Formula Rich Text button, that when clicked, checks a box that triggers a pipeline and launches a code page while a the pipeline creates child records in two other tables. All of that works fine except for the fact that it will not link the parent to the child records if i select the button in Edit mode. I'm trying to Save the record first and then trigger the pipeline/code page. My formula is below. Hoping someone can offer guidance with the Save Before Navigating portion. Any thoughts would be greatly appreciated! 

    Rich Text Button:

    var text OGURL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=dtu36fpy5drric3na9jkc2hufbe" &

    "&_fid_123=" & URLEncode("true") &
    "&_fid_151=" & URLEncode("false") &
    "&_fid_103=" & URLEncode("false") &
    "&_fid_104=" & URLEncode("false") &
    "&rdr=" &
    URLEncode(URLRoot() & "db/" & Dbid() & "?act=dr&rid=" & [Record ID#]);

    var text Refresh = URLRoot() &"db/" & [_DBID_PROJECTS] & "?a=er&rid=" & URLEncode([Next Project Rid]);

    var text DBPage = "/db/" & Dbid() & "?a=dbpage&pagename=WaitForSalePipeline.html&rid="& [Record ID#]&"&rdrurl="& URLEncode($Refresh);
    //&"&url="& URLEncode($Action)&"&rdrurl="& URLEncode($Refresh);

    var text URL =
    $DBPage;
    //&"&rdrurl="& URLEncode(URLRoot() &"db/" & [_DBID_PROJECTS] & "?a=dr&rid=" & URLEncode(116));
    //$Action & "&rdr=" & URLEncode($DBPage);

    var text buttonText = "SALE";

    var text style = "display: flex;"
    & "align-items: center;"
    & "background: #1ba237;"
    & "border-radius: 3px;"
    & "padding: 10px 15px;"
    & "color: White;"
    & "text-align: center;"
    & "text-decoration: none;"
    & "font-size: 13px;"
    //& "font-weight: Bold;"
    & "font-style: Normal;"
    & "display: inline-block;";

    If(
    [Related Customer] < 1,
    "<div style='display:flex; justify-content:left;'>"
    & "<a style='"& $style & "' href='"& $url &"'target='_self';><span syle='text-align: left;'></span><span>"& $buttonText &"</span></a>"
    & "</div>", ""
    )

    ------------------------------
    Todd Molino
    ------------------------------


  • 2.  RE: Rich Text Field - Save Before Navigating

    Posted 12-02-2021 14:53
    Not sure about the sequence things fire, but I can tell you these are my cheat notes on how to utilize save before navigating in a button:

    "<a class='SaveBeforeNavigating' style=\"text-decoration:none; background: #688EB3; border-radius: 5px; color: #ffffff; display: inline-block; padding: 4px 0px 0px 0px; width:145px; height:22px; text-align: center; text-shadow: none; border: 0px solid #030404; font-size: 12px \"href='"
    & $URL
    & "'>Button Words Here</a>"

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