Discussions

Expand all | Collapse all

Save and redirect back to a report

  • 1.  Save and redirect back to a report

    Posted 05-23-2018 02:46
    Hey everyone!!  I am trying to create my own "Save and Redirect" button.  This button will live on Form 16 of the [_DBID_LEADERS2]  table and ultimately take me to Report 27 after the SAVE.  (and yeeeesssss...i know...QB doesnt support us creating our own Save Buttons) :-)

    Below is what I have written so far (borrowed from Kelly...thank you!!).  What I haven't been able to piece together is "URLSEVENChangeLeaders" and onclick='DoSaveAdd() to create the Save/Redirect part i'm looking for.  

    ***URLFOUR is also currently not working right either...it was also a failed attempt at a "save/redirect" button.  It is supposed to "update what is on form 16 and take me to the Change Leaders report as well.  No worky!!  HELP!!


    // Begin button style
    var text ViewOnFormSixteen = URLRoot()  & "db/" & Dbid() & "?a=q&qid=27&nv=1&v0=" & [Record ID#];
    var text bgcolor = "#008522";
    var text txtcolor = "white";
    var text bgcolorstylethree = "#304cb2";
    var text txtcolorstylethree = "white";
    var text URLONE = URLRoot() & "db/" & Dbid() & "?a=er&dfid=16&rid=" & [Record ID#];
    var text URLFIVEValidatePayPeriod = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & ToText([Record ID#]) & "&dfid=18";
    var text URLSEVENChangeLeaders = URLRoot()  & "db/" & [_DBID_LEADERS2] & "?a=q&qid=27&nv=1&v0=" & [Record ID#];
    var text URLFOUR = $URLONE & "&NextURL=" & URLEncode($ViewOnFormSixteen);

    var text style = "style=\"width: 175px;  line-height: 1.5; text-align: center;  text-decoration: none; background:" & $bgcolor & "; border-radius: 5px; padding: 10px; margin: auto;  font-weight: normal; font-size: 12px; text-align: center; display: inline-block; color: " & $txtcolor & "; font: normal 700 24px/1 \"Calibri\", sans-serif;";

    var text stylethree = "style=\"width: 175px;  line-height: 1.5; text-align: center; text-decoration: none; background:" & $bgcolorstylethree & "; border-radius: 5px; padding: 10px; margin: auto;  font-weight: normal; font-size: 12px; text-align: center; display: inline-block; color: " & $txtcolorstylethree & "; font: normal 700 24px/1 \"Calibri\", sans-serif;";


    "<div>" &
    //"<a " & $style & " href='" & $URLFOUR &"'>Not working</a>" & "&nbsp;&nbsp;" &
    "<a " & $stylethree & " href='" & $URLFIVEValidatePayPeriod &"'>Validate Pay Periods</a>" & "&nbsp;&nbsp;" &
    "<a " & $stylethree & " href='" & $URLSEVENChangeLeaders &"'>Change Leader Report</a>" & "&nbsp;&nbsp;" &
    "<a " & $style & " onclick='DoSaveAdd()'href='#'>Save Changes Here</a>" & "&nbsp;&nbsp;"

    Thank you anyone/everyone who can help me!!  


  • 2.  RE: Save and redirect back to a report

    Posted 05-23-2018 16:45
    This can be achieved with Dandiebolt's "Save and Scooby Doo" method.  Found here:

    https://community.quickbase.com/quickbase/topics/what-is-the-save-and-scooby-doo-technique


  • 3.  RE: Save and redirect back to a report

    Posted 05-23-2018 16:52
    Thanks Scott, but is there a way to do it without using the Image Onload Technique?  


  • 4.  RE: Save and redirect back to a report

    Posted 05-23-2018 16:56
    Howdy Jana,

    The Save and Scooby Doo technique is utilized alongside IOL.  There may be an easier way to do this with simply the IOL technique and overriding the DoSave() method that the save button uses.. But I'm not sure how you'd really write that out.  (Or rather it'd take me quite a while filled with furious googling!)

    Reference to overwriting QB functions here: https://community.quickbase.com/quickbase/topics/is-there-a-way-to-make-it-harder-to-delete-a-record...

    You'd pretty much just take the DoCheckHandled section and modify it for the new save function.

    Scott.