I also have this same issue. From a button (rich text formula field), I am trying to do a SaveBeforeNavigating and call a code page to refresh with a delay, using the example from the Code Page Sample App. My problem is that in the redirect, it takes me to adding a new record instead of redirecting me back to the record I was already on. The code for the button worked correctly before I added the call to the code page. The only problem was that I had to keep manually refreshing the form before I could see the results because the pipeline takes so long to run. I am pretty new to Quickbase. Can you help me figure out how to go back to the record I was on in Edit mode? Here's the code from the button (the code page is basically the same as the code in the Code Page Sample App):
var text rid = If([Record ID#]>0, ToText([Record ID#]), "%%rid%%");
var text urlToExecute = URLRoot() & "db/" & Dbid() & "?a=er&rid=";
var text url = URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=2" // Open code page 2
& "&url=" & URLEncode($urlToExecute) & $rid; // Pass in the URL to execute
"<a class=\"Vibrant Primary SaveBeforeNavigating\" data-replaceRid=\"true\" href=\"" & $url & "\">Show Results</a>"
------------------------------
Teresa Steeg
------------------------------