Forum Discussion

GrantK's avatar
GrantK
Qrew Trainee
20 days ago

Button to Add Record via Pipeline, and refresh Record

Hi All,

I am having troubles trying to via a button to add a new record then refresh the current record.

As a button can't trigger a Pipeline, I've created a checkbox field to act as a trigger field. Currently the button uses an API_EditRecord to edit the checkbox and refresh the record. The API_EditRecord triggers my pipeline however the refresh happens before the Pipeline has a chance to complete.

I saw this thread where we can create a HTML Code page to do a pause and refresh.

https://community.quickbase.com/discussions/quickbase-discussions/save-new-record-pause-refresh/19873/replies/19876

I thought I might be able to tag that to the end of my current URL code to run afterwards, however it seems with the record refresh, it never gets to this part.

My current code is as follows.

URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_371=1" & "&apptoken=xxxxxxx" & "&rdr=" & URLEncode( URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl()) & URLRoot() & "db/" & Dbid() & "?a=dbpage&pageID="&715 &"&rid=" & [Record ID#]

My question is:

  1. Is there a way to get the above code to run all parts or
  2. A way via the delay/refresh html code page to edit the checkbox which should trigger the Pipeline then continue with the delay/refresh html script?

 

I used a Pipeline rather than an API_AddRecord as there are  30+ fields that need to be copied from one table record into another, plus update the record with the button with the related new record ID.

 

Thanks.

  • Here are some thoughts and resources.

    1. discussion blog here https://community.quickbase.com/discussions/quickbase-discussions/using-code-pages-to-refresh-with-a-delay/83697
    2. Code page example app here https://resources.quickbase.com/db/bq8kmgrcq/72b77352-3b9d-495e-932f-1cd9f1b15fa3
    3. An alternative is to power through that button to add the child record using the URL formula syntax thus providing a good user experience to see the child record on refresh, but use a Pipeline to write back the RID of the newly created record to its parent.  Your user probably does not need that immediately on refresh.  You would trigger the Pipeline on the creation of the child record. 
    4. Put the child table in a Tab such that by the time the user opens the tab, the pipeline will have run.  I vividly recall being at an in person EMPOWER event when Automations first came out and QuickBase used that sleight of hand to allow time for the Automation to complete.
    • GrantK's avatar
      GrantK
      Qrew Trainee

      Hi Mark,

      Thanks for the tips. I managed to get it working using the code page sample. I didn't get around to trying point3&4 but understand the thought process and will remember it for possible future requirements. Thanks again for your assistance.