Forum Discussion

StephanieStepha's avatar
StephanieStepha
Qrew Trainee
9 years ago

Use the Image Onload Technique to redirect to a specific report - or some other method.

I am trying to accomplish something with either the Image Onload Technique - or via my Formula URL, using an icon as a button.

I have a parent table where the user clicks a button to add a "detail" on the child record.

Once that window opens, they will fill out specific information, and then of course save the record.

What I WANT to happen, is for them to click on the Save Button/Icon, and it saves the record and then puts them back on the original parent record they came from - OR a specific report could work also.

An alternative could be:  They click on the save button, it saves and then closes the window they are on.  

What I have now - I have a button that they can click to save and it keeps them on the same record.  I also have working the Image Onload Technique that will save the record and then redirect to the homepage of the app.

I need to either redirect to the homepage of the app, or have it close the current window.  Can anyone help me with that one last step??

Here is my IOL code:
$("#RedirectURL").val(gReqAppDBID);
$("input[name=rl]").val("");

Here is my button code:
var text URL = "javascript:void(DoSaveAdd())";
var text URLtwo = URLRoot() & "db/" & [_DBID_APPOINTMENTS] & "?a=dr&rid=" & ToText([Related Appointment]);
var Text Image = "<a id='saveButton' class='Vibrant Success' onclick='DoSaveAdd()' href='#'>Submit</a>";

"<b href =" & $URL & URLEncode($URLtwo) &">" & $Image & "</b>"

Thanks in advance for any help

4 Replies

  • Is there any particular reason you're using this method over the standard "Add Record" buttons created by QuickBase?
  • I have answered this with some amazing help from Dan Diebolt and his techniques using javascript.  

    I want to say this in earnest to anyone who may be in a similar situation as I am...  our Company has grown rapidly and we are working to improve and expand our Quickbase along with it.  We have requirements and ideas outside of what the native Quickbase function allows.

    I am learning and now know that there ARE ways to do just about anything you want or need to do in Quickbase.

    **It will be worth your time to explore and learn what Dan is teaching with his Image Onload technique and other methods of employing javascript within your QB pages.  Instead of chasing these patched together formulas that are time consuming and difficult to figure out, you can have a quick, efficient answer.

    I went from the convoluted attempt you see above to now having my solution and it is literally accomplished on 2 lines of javascript and has no more than about 20 characters.. I also have a plethora of other possibilities I can now explore.

    THANK YOU, Dan!!
    • CarlosCarlos's avatar
      CarlosCarlos
      Qrew Assistant Captain
      Stephanie, could you comment on how you went about solving this? I actually have the exact same question as you did 3 years ago.
      thanks!