Forum Discussion

Re: Create Record, pause, then display record

Mike - try this: 


    function Run() {
        let urlParams = new URLSearchParams(window.location.search);
        let rid = urlParams.get('newRID');
        let dbid = urlParams.get('newDbid');
        let yourRealm = "sesgroup";
        let url = `https://${yourRealm}.quickbase.com/db/${dbid}?a=dr&rid=${rid}`
        if( dbid && rid ) {
          setTimeout(() => {
            window.location.replace(url)
          }, 1000)
        } else {
          console.log("something went wrong with your parameters", {dbid, rid, yourRealm, url})
        }
    }

    Run();
I stripped out the fetch to make this function even simpler. I'm not sure what the original intent of why it was done this way - but it's not that complicated so this just checks to make sure you have the right parameters and if so does your redirect after 2.5 seconds. Take it for a spin and see if it works. 


------------------------------
Chayce Duncan
------------------------------

5 Replies

  • MikeTamoush's avatar
    MikeTamoush
    Qrew Elite

    Brilliant that worked thank you!

    By the way, any recommendations on learning java? Or just, look around for courses.....



    ------------------------------
    Mike Tamoush
    ------------------------------
    • ChayceDuncan's avatar
      ChayceDuncan
      Qrew Captain

      I'm sure everyone will have a different answer than me, your best bet is to just get the basics with something like codecademy or simple courses on Udemy just to get structure, syntax and the overall basics down. Beyond that - it's just trial and error. If you're just focusing on codepages then you only need to focus on HTML, CSS and Javascript, along with a general understanding of APIs and specifically the Quickbase api outside of the context that you use them in native URL buttons. 

      Beyond that - it's just practice. You won't find any kind of training of guides to Quickbase codepages so really just comes down to finding a use case and slogging through it to learn. 



      ------------------------------
      Chayce Duncan
      ------------------------------
      • MikeTamoush's avatar
        MikeTamoush
        Qrew Elite

        Thanks.

        Also, my plan was close to brilliant except it fails if someone deletes the most recent child. If so, then the max Record ID of the table may be 100, but in reality the next record ID created will be 102. I can probably get around this by creating a dummy orphaned child any time someone deletes the most recent record ID, but even though it works, I don't love my solution. Either way, your code is awesome and I will use it in some fashion. Thanks!



        ------------------------------
        Mike Tamoush
        ------------------------------