NextURL was working in the morning, and stopped in the afternoon? What am I missing?
Hi all,
In one of our apps, we have a table called Projects and another child table called Project Staff. On the Projects table, we have a collection of URL buttons to create new Project Staff records for specific project roles.
For example, there's a dedicated button labeled "Add SPM" to create a Project Staff record in a pop-up and pre-set the value of the "role" field to "Senior Project Manager." The user then just selects the name of a Senior Project Manager from a filtered drop-down list, and clicks Save.
Yesterday, I created a new Formula Rich Text version of this button with the goal of having the pop-up close automatically after the user clicks the "save" button, and then refresh the Projects record they started from. Working from a simple code page/button example I found here, I was able to get it working. I added 5-6 Project Staff records using this new button, and every time, it did what I wanted. Yay!!!
Then a few hours later, I circled back to customize the text & color of the new button, and suddenly the pop-up stopped closing when I saved! The original Projects record still refreshed when I manually closed the pop-up though. (Suggesting that the HTML of the button itself is still working.)
After much experimentation & troubleshooting, it seems like the NextURL aspect of the code just isn't working. As a test, I've tried setting that URL to simpler, non-QB URLs, and it still does nothing. You click save on the pop-up, and the new Project Staff record saves, but the pop-up just sits there.
At this point, I've even tried starting over from scratch, with a new button and a brand new code page at a different page ID etc -- but the results are the same.
Below is one iteration of the code I've been trying. Can anyone see any issues with what I've got? Thank you!
var text url = URLRoot() & "db/" & [_DBID_PROJECT_STAFF] & "?a=API_GenAddRecordForm&_fid_10=" & URLEncode ([Project Number]) & "&_fid_14=Senior Project Manager" & "&ifv=1"
& "&NextURL=" & URLEncode(URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=4"); // Open code page 4 to close the popup
"<a class='Vibrant Danger OpenAsPopup' href='" & $url & "' data-height=600 data-width=600 data-refresh=true title='Clicking this button will open a popup'>Add SPM</a>"
In my notes and observations from using NextURL:
- It can redirect to most Quickbase pages, even in other apps;
- It never worked with non-QB pages;
- It does not work with IFV=1, which it looks like you are using.