Forum Discussion
Chayce,
I tried your solution but am getting the dreaded "404 Error, Page Unrecognized" popup when I hit the button. I must not be integrating your solution correctly. Here is my code for the formula rich text (button).
---------------------------------------------------------------------------
var text SplashPage = URLRoot() & "db/" & Dbid() & "?a=dbpage&pageID=12";
var text URL = URLRoot() & "db" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_7="& Now() & "&rdr=" & URLEncode($SplashPage);
"<a class='Vibrant Success OpenAsPopup' data-height=950 data-width=500 data-refresh=true href=\""& $URL &"\" >Hit Me</a>"
------------------------------
Aaron B
ab1692@att.com
------------------------------
That might be my fault, I must have copied something incorrectly as it's co-mingling ' and ".
Try it again as
var text SplashPage = URLRoot() & "db/" & Dbid() & "?a=dbpage&pageID=12";
var text URL = URLRoot() & "db" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_7="& Now() & "&rdr=" & URLEncode($SplashPage);
"<a class='Vibrant Success OpenAsPopup' data-height=950 data-width=500 data-refresh=true href='"& $URL &"' >Hit Me</a>"
*the only change was to replace \" with ' around the $URL variable.
------------------------------
Chayce Duncan
------------------------------
- ChayceDuncan2 years agoQrew Captain
Nevermind, I checked again and the issue is with your splash page reference. You need to swap out DBID() with AppID() as dbpages are at the application level, not table DBID level
var text SplashPage = URLRoot() & "db/" & AppId() & "?a=dbpage&pageID=12";
------------------------------
Chayce Duncan
------------------------------- AaronB2 years agoQrew Trainee
Interesting...when I remove the portion that updates the record, the popup window opens just fine, (regardless if I use DBID or AppID). So the issue must be somewhere in my 'edit record' portion of the call, and not the potion that calls the popup.
This was similar to my original code (using a formula URL field) but the original code actually got farther. The popup showed up just fine and the record updated. It just wouldn't automatically refresh the original page when I closed the popup.
This code brings up the popup just fine but when I add the 'update record' portion, it fails with the 404 error:
var text url = URLRoot() & "db/" & Dbid() & "?a=dbpage&pageID=12";
"<a class='Vibrant Success OpenAsPopup' data-height=950 data-width=500 data-refresh=true href=\""& $url &"\" >Hit Me</a>"
------------------------------
Aaron B
ab1692@att.com
------------------------------- ChayceDuncan2 years agoQrew Captain
Yes, now that I'm looking at your URL again you're missing a / after db
CURRENT:
var text URL = URLRoot() & "db" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_7="& Now() & "&rdr=" & URLEncode($SplashPage);CORRECTED:
var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#]
& "&_fid_7="& Now() & "&rdr=" & URLEncode($SplashPage);Sorry for not catching. I was able to get it to work in my own environment so hopefully that is the final issue.
------------------------------
Chayce Duncan
------------------------------