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 new record within the same URL? I tried the following, but got the error message "Missing "rid" parameter"
"URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=%%rid%%"
&"&_fid_20="&URLEncode("Yes");
My intention is to use one button instead of two buttons to provide the function:
(1) save the current new record (2) edit this new record.
Any suggestion? Thanks in advance!
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>"