Discussions

Expand all | Collapse all

Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

  • 1.  Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

    Posted 01-24-2018 23:35
    I would like to add a customer query string parameter after clicking the Save & Close button.
    For example, https://blank.quickbase.com/db/dbid?a=er&rid=1<b>&customeQueryStringParam=customValue</b>
    I'm aware of how to do this with a custom button, but for this case, I would like to do this after clicking QuickBase's button.
    Thanks in advance!


  • 2.  RE: Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

    Posted 01-24-2018 23:37
    Matt, can you explain the purpose of this request, ie what are you trying to accomplish here?


  • 3.  RE: Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

    Posted 01-24-2018 23:42
    Thanks for the speedy response!
    I'm trying to pass in which tab the user was on when they clicked the Save & Close button, so I could use some jquery to "click" them back to that tab after they have saved and they are back in view mode.


  • 4.  RE: Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

    Top
    Contributor
    Posted 01-24-2018 23:56
    You can include any query parameter you want in the URL so long as you do not conflict with  existing parameters - QuickBase will just ignore it. But you will have to arrange for script run in the page using an injection technique -  such as IOL -  that will read the URL parameter and synthesize a click on the appropriate tab. The relevant code to extract the query string parameter is this:

    var urlParams = new URLSearchParams(window.location.search);
    var customValue  = urlParams.get("customeQueryStringParam");


  • 5.  RE: Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

    Posted 01-25-2018 00:12
    Thank you for your response. I'm able to set and get the query string param when creating a custom button because adding the query string is as easy as adding it to the URL in the formula field.
    The part I'm having trouble with is inside of my script (which is using the IOL technique), I'm unable to set a query string param that will show up in the URL once the page goes from Edit mode back to View (after clicking the Save & Close button).


  • 6.  RE: Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

    Top
    Contributor
    Posted 01-25-2018 00:30
    Generally when you submit a page the server alone will control what page you redirect to so you have no control over that form of submission. However there is a crude form of redirection built into QuickBase forms that continues to work (I just manually tested it).

    If you sent these two hidden fields as follows when the page submits you will save the record and redirect to ibm.com (replace with your URL):
    $("input[name=RedirectURL]").val("http://www.ibm.com");
    $("input[name=rl]").val("");
    I don't often use this method as QuickBase could easily rework the form submission process and eventually they will. Try pasting the code into the console before putting it in a code page.


  • 7.  RE: Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

    Posted 01-25-2018 00:42
    Worked perfectly, thanks a lot!


  • 8.  RE: Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

    Top
    Contributor
    Posted 01-25-2018 12:50
    If it works that is the end of it so party on. However, you can probably accomplish the same result without passing custom query parameters. Just do everything in one single script and skip over the parameter passing.


  • 9.  RE: Is there anyway of adding a custom query string parameter after clicking the Save & Close button?

    Posted 08-20-2018 16:07
    Another way to do this is to create a custom button "Save & same tab" which works like (and actually uses) the standard "Save & keep working" button except that it navigates back to the same tab. For details see this new post, which also includes a "Save & next tab" button.