Forum Discussion

Hongkunliang's avatar
Hongkunliang
Qrew Cadet
9 months ago

Button: save the new record and edit the new record

Hi,  From the previous post (Add Save and Keep Working Button on form for a new record ), Hunter provided a wonderful solution to save the new record. If going further, is it possible to edit the n...
  • Hongkunliang's avatar
    9 months ago

    Hi Mike,

    Thanks for your hint.  I made it works by moving the RID out the URLEncode.

    Here is the final code:

    var text RID = If([Record ID#] > 0, ToText([Record ID#]), "%%RID%%");
    var Text edit=URLRoot() & "db/" & Dbid() &
    "?act=API_EditRecord&rid="&$RID
    &"&_fid_20="&URLEncode("Yes");

    var text reDirect =
    URLRoot() & Dbid()?act=er&rid=";

    var Text URL=$Edit
    &  "&rdr=" & URLEncode($reDirect)& $RID;

    "<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #4b7097; border-radius: 5px; color: #ffffff; display: inline-block; padding: 0px 0px 0px 0px; width:200px; text-align: center; text-shadow: none; border: 2px solid #0863f5; font-size: 16px \"href='"
    & $URL
    & "'>Issue Announcement</a>"