Forum Discussion
Quick_BaseJunki
Qrew Captain
@Brittany Scheid Ahhhh, I missed that in my last reply.
On the code page, update this line of text:
to
assuming your form id is 12
Please note, this will render the code page less versatile for multiple uses since it will be hard coded to return to this specific form. But this is the simplest way to achive your goal.
-Sharon
------------------------------
Quick Base Junkie
Quick Base Junkie
https://quickbasejunkie.com
------------------------------
On the code page, update this line of text:
window.location.href = document.referrer;
to
window.location.href = document.referrer + '&dfid=12';
assuming your form id is 12
Please note, this will render the code page less versatile for multiple uses since it will be hard coded to return to this specific form. But this is the simplest way to achive your goal.
-Sharon
------------------------------
Quick Base Junkie
Quick Base Junkie
https://quickbasejunkie.com
------------------------------
BrittanyScheid
2 years agoQrew Cadet
So that got me to the right form, but because the starting page is adding a new record, it pulled up the correct form, but for adding a new record. Is there any way to get it to save that new record, go to the pause code page, then redirect to form ID 12 for that record that was just ssaved?
------------------------------
Brittany Scheid
Special Projects Manager
SimiTree
------------------------------
------------------------------
Brittany Scheid
Special Projects Manager
SimiTree
------------------------------
- BrittanyScheid2 years agoQrew CadetThat worked like a charm! Thank you so much Sharon! I will definitely look into taking the Button Masterclass. Thanks again!
------------------------------
Brittany Scheid
Special Projects Manager
SimiTree
------------------------------ - Quick_BaseJunki2 years agoQrew Captain@Brittany Scheid I had a sneaking feeling you might bring that up...
I really recommend The Button Masterclass so that these elements can be better understood.
Several additional changes will need to be made.
1. Change your field from a URL Formula to a Rich Text Formula.
2. Change the formula to something like this:
var text RID = If(IsNull([Record ID#]),"%%rid%%",ToText([Record ID#])); var text urlToExecute = URLRoot() & "db/" & Dbid() & "?a=er&dfid=12&rid="; var text URL = URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=6" // Open code page 6 & "&url=" & URLEncode($urlToExecute) & $RID ; // Pass in the URL to execute var text LABEL = "Custom Save & Keep Working"; "<a class='Vibrant Success SaveBeforeNavigating' data-replaceRid=true href='" & $URL & "'>" & $LABEL & "</a>"
3. Update the code page's errRdr function
function errRdr(){ let urlParams = new URLSearchParams(window.location.search); let url = urlParams.get('url'); // Redirects to the previous page, if this page was the previous page as well, then redirect to the app home page if(document.referrer && document.referrer !== window.location.href) { window.location.href = url; }else{ window.location.href = window.location.origin + window.location.pathname; } }
CAUTION the use of the %%rid%% record id replacer will only work if an actual change is made to the new record before the button is pressed. (ie starting a new record and then immediately clicking the button will not force the record to save because there is nothing to save).
-Sharon
------------------------------
Quick Base Junkie
Quick Base Junkie
https://quickbasejunkie.com
------------------------------