Forum Discussion

Re: How to Add CurrentUser to User List field

There is an example of some code which will set the value in a field and then refresh the page. The beauty of this is even though you might be pressing the button on a link from an embedded child record it will refresh the whole Quickbase page that you were already on and not just display the child record.

var text Approve = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#])
& "&_fid_144=Approved";

var text RefreshPage =  URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();

 
$Approve
& "&rdr=" & URLEncode($RefreshPage)



------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------

5 Replies

  • JosephMahon's avatar
    JosephMahon
    Qrew Cadet

    This works perfect!  Thank you!

    One other thing I thought of.... Is there a way to get it to load the parent table but in view only mode.  

    This whole set up works, but the pipeline doesn't run fast enough and after pushing the button, we need to refresh the page for the pipeline to have taken effect. 



    ------------------------------
    Joseph Mahon
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend

      Well, you can have the last line read 

      var text DisplayParent=  URLRoot() & "db/" & [_DBID_PARENT_TABLE_NAME]

      & "?a=dr& rid=" & [Related Parent];

       
      $Approve
      & "&rdr=" & URLEncode($DisplayParent)

      As for the issue of the embedded child table not updating quick enough due to the pipeline speed,  one trick is to have that embedded table be in a Tab which is not the main tab. That will force the user to click a Tab to display the child table and by the time they click the button there's a good chance the pipeline will have run. 

      What does the pipeline do when you click the URL Formula button? Perhaps the URL formula button itself can do the updates you need. 



      ------------------------------
      Mark Shnier (Your Quickbase Coach)
      mark.shnier@gmail.com
      ------------------------------
      • JosephMahon's avatar
        JosephMahon
        Qrew Cadet

        I appreciate all of the help!  It is almost working perfect. The pipeline runs and the ultimate goal is achieved but I am getting an error with this code:

        var text Approve = If([Import Note Check Box] = false, URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#])
        & "&_fid_39=1",URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#])
        & "&_fid_39=0");

        var text DisplayParent=  URLRoot() & "db/" & [_DBID_EPISODES_OF_CARE] & "?a=dr& rid=" & [Related Episode];

         
        $Approve
        & "&rdr=" & URLEncode($DisplayParent)

        I think it has to do with [Related Episode] 

        Here is the function:

        Our staff dictates notes into the child table while on the road.  When they come home and go into the Parent Table and click the URL button we are creating here. This checks a box on the child record and then triggers a pipeline.  The pipeline maps the fields from the child table to the parent table.  There are about 12-15 fields. 



        ------------------------------
        Joseph Mahon
        ------------------------------