Forum Discussion

MikeTamoush's avatar
MikeTamoush
Qrew Commander
11 months ago

Create Record, pause, then display record

I know how to create record and display by using the "&disprec=1" tag. I also have used the example code page that allows you to pause and refresh. I would like to combine, as in my use case when I create the parent, I have actions fire which create 3 children. On mobile, it refreshes before the children are created, so i want to add a pause.

However, I cannot get it to create the parent, pause, then display the parent. Any ideas?



------------------------------
Mike Tamoush
------------------------------
  • Can you not use the same code page approach? Have your button save the record and use the %%rid%% to pass in a parameter like &rid=%%rid%%, then in your code page grab the parameter from the URL and redirect the user back to the page after a setTimeout()



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

      That probably would work if I knew Javascript. As it is, all I can try to do is modify the existing code page which I have tried and failed miserably. Turns out you can't really just guess your way through a programming language :)



      ------------------------------
      Mike Tamoush
      ------------------------------
      • MikeTamoush's avatar
        MikeTamoush
        Qrew Commander

        Actually that wont work. The problem is I am not on the parent record when it is 'saved'.

        I am on a grandparent (though, at the time of the button push, it is not a parent or grandparent, it is a single record). I push a button and it runs the AddRecord API, adding a child. I want to delay, and then land on this child. I would need to somehow pass the RID of the new child.&disprec=1 performs some sort of magic that auto displays the newly created record. I would somehow need to know what magic it performs, and pass that magic into the code page.

        Though it did just dawn on me, i can look up the max record id in the child table, and navigate to 1 more than that.....if I can figure out how to pass that +1 record ID to the code page....ill try it.

        Update - I am not good enough at javascript to modify the code page, but I suspect my idea would work. But, i would need a parent table to get the max record id and pass it back through, which i can do but is a bit annoying...not sure there are any other solutions though.



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

    • MikeTamoush's avatar
      MikeTamoush
      Qrew Commander

      Actually, might not even need the pause using that magic button Simon. Ill take a look, thanks!



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