Forum Discussion
ElishaTenenbaum
Qrew Cadet
Hi there
My apologies for the delayed response. I'm new to javascript & quickbase and at the time of my initial posting these responses were beyond my skill level.
I've advanced a little and decided to give these solutions another go. I�m not sure how & where to plug in these different lines of code.
I tried putting Dan�s code
1) directly into a formula-url field and I get a syntax error.
2) directly into a formula-rich text I�d be redirected to ibm.com whenever I viewed a record
3) into a javascript page and loading it via iol and it would save the record but the redirect wouldn�t work
Similar challenges with Sharons & QBChampions solutions. I'm no sure how/where to put together and plug in the code.
I've had a bunch of success using some IOL scripts for other issues.
Any guidance on how to plug in your answers?
Thanks!
QuickBaseJunkie
6 years agoQrew Captain
Both my and Mark's (QB Coach) suggestions work in the Formula URL field.
Here is the formula I suggested more explicitly written out using your inital formula as a base:
var text URL = "javascript:void(DoSaveAdd())";
var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=dbpage&pageID=3";
var Text Image = "<a id='saveButton' class='Vibrant Success' onclick='DoSaveAdd()' href='#'>Submit</a>";
"<b href =" & $URL & "&rdr=" & $URLTWO &">" & $Image & "</b>"
(where the pageID=3 is replaced with your pageID).
-Sharon
Here is the formula I suggested more explicitly written out using your inital formula as a base:
var text URL = "javascript:void(DoSaveAdd())";
var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=dbpage&pageID=3";
var Text Image = "<a id='saveButton' class='Vibrant Success' onclick='DoSaveAdd()' href='#'>Submit</a>";
"<b href =" & $URL & "&rdr=" & $URLTWO &">" & $Image & "</b>"
(where the pageID=3 is replaced with your pageID).
-Sharon
- BrittanyScheid3 years agoQrew CadetNever mind! I found another post that explained how to create a formula-rich text field that acts as the "Save & Keep Working". I just updated the URL to include the form ID to get what I needed. Here's the post for anyone else who's interested.
https://community.quickbase.com/communities/community-home/digestviewer/viewthread?MessageKey=d959cde4-8af7-4499-b793-c3f8807c57cd&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer
------------------------------
Brittany Scheid
Special Projects Manager
SimiTree
------------------------------- QuickBaseJunkie3 years agoQrew Captain@Brittany Scheid I'm glad you found a solution.
I also have a video that covers the "SaveBeforeNavigating" class (about halfway through the video below) that might be helpful to you or others. AND if you want to learn even more about building buttons in Quickbase I'd recommend The Button Masterclass.
------------------------------
Quick Base Junkie
Quick Base Junkie
https://quickbasejunkie.com
------------------------------- BrittanyScheid3 years agoQrew CadetThat is helpful, thanks! Is there a way to have the action pause in between when the record saves and the next page displays? I have a pipeline that runs when the record is saved, and I want that to be finished before displaying the next page. I tried looking at the examples on Code Pages App, but the examples are either Prompt & Redirect, or Run, Pause & Refresh. I would need something like Save, Pause & Redirect. I don't know javascript really at all to be able to figure out what needs to be changed.
------------------------------
Brittany Scheid
Special Projects Manager
SimiTree
------------------------------
- BrittanyScheid3 years agoQrew Cadet@Quick Base Junkie What field type does this code get used in? When I tried both Formula-URL & Formula-Rich Text, I received syntax errors saying javascript was not allowed. (screenshot below). I've included my code below as well.
My scenario is that I'm actually not saving a parent record, but wanting to save the record being edited, and bring up that same record but in a different form. Almost like the "save & keep working" but using a different form. Would turning on the "Save parent record automatically when a child record is created" option address this too, negating the need for the javascript?
var text URL = "javascript:void(DoSaveAdd())";
var text URLTWO = URLRoot() & "db/" & [_DBID_EVENTS] & "?a=er&dfid=12&rid=" & [Record ID#];
var Text Image = "<a id='saveButton' class='Vibrant Success' onclick='DoSaveAdd()' href='#'>Submit</a>";
"<b href =" & $URL & "&rdr=" & $URLTWO &">" & $Image & "</b>"
------------------------------
Brittany Scheid
Special Projects Manager
SimiTree
------------------------------