Forum Discussion
The issue is that you want a button which will work in both ADD Mode and EDIT mode. But in ADD mode, the Record ID# does not yet exists. So you need to use a field type of Formula Rich Text (not formula URL) and have the button first save the record and then edit it.
var text RID = If([Record ID#]>0, ToText([Record ID#]), "%%rid%%");
var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & $RID
& "_fid_20=" & URLEncode("success")
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=") & $RID;
"<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #117a39; border-radius: 5px; color: #FFFFFF; display: inline-block; padding: 4px 4px 4px 4px; width:140px; text-align: center; text-shadow: none; border: 2px solid #0863f5; font-size: 12px \"href='"
& $URL
& "'>Set as Success</a>"
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
I actually don't care about add mode as this will only be done on existing records, so I'm only doing it off of the edit form OR have it as a field in a report and you can just click it to have it go through. I have also tried the "%%rid%%" solution, and copy and pasted this code as well, but still keep coming up with the same error
------------------------------
Nolan Pilozo
------------------------------
- MarkShnier__You10 months agoQrew Legend
I just noticed there is an error in this line. Make this correction.
& "&_fid_20=" & URLEncode("success")
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------ - NolanPilozo10 months agoQrew Member
that seems to be the fix that was holding us back. I'll play around with it to redirect it but it's updating the record properly now! Thanks both
------------------------------
Nolan Pilozo
------------------------------