Forum Discussion

RyanLocke1's avatar
RyanLocke1
Qrew Cadet
3 years ago

Pipeline Notification

I have a pipeline that is setup for our Accountant to run when they select a date range and client and then it will assign all the entries in the child table to the parent invoice record. To make sure the Accountant doesn't create the invoice until all records have been linked are there any 'fool-proof' mechanisms to show the pipeline is finished on the Parent Record? I have been testing and there will be instances where I have to refresh a few times before the the Total Invoice amount is correct.

------------------------------
Ryan Locke
------------------------------
  • I have two ideas. The first is I am guessing that your current pipeline search his records and then as each qualifying record is found it is updating the records individually.  If if you were doing that, that is not really a best practice for Quickbase because essentially you are pinging against the QuickBase app many times as you do these individual updates.

    A recommended practice is that you would create a Bulk Upsert, then do your search and then in a for each loop in the search you put records into the bulk upsert. Then at the end of the process you do a step called commit bulk upsert.  The effect of that is that all the qualifying records will be imported all at once so it is basically impossible for your users to see half the results. They will see nothing and then they will see everything.  

    But, another thing you can do is to have a step at the beginning of your pipeline, or ideally if the pipeline is being triggered by a form of the URL button, the button can do this update to set a date time field for the time that the pipeline was started and then have the last step in the pipeline update a different field [Pipeline completed at] to the current date time. Then you could have an icon which displays a completed check box when the completion time is greater than or equal to the start time.

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • RyanLocke1's avatar
      RyanLocke1
      Qrew Cadet

      Hey Mark,

      Great tip, but I am having an issue with the Bulk Upsert..I will want it to Trigger when someone creates an Invoice record so I set it up like this and everything works, but when it upserts back into the Time Entry table it doesn't update the Related Invoice field with the Invoice number that was just created in the Invoice Table. I am sure this is a total operator error on my end...first bulk upsert. Thank you for helping!

      A - Record Created -
             Table - Invoices
             Fields Used - Related Prospect, Period From Date, Period To Date
      B - Prepare Bulk Record Upsert
            Table - Time Entries
            Fields - Related Invoice
            Merge Field Record ID
      C - Search Records
            Table - Time Entries
            Fields - Related Invoice, Related Prospect, Date
            Query - Related Prospect = a.related_prospect & Date is Between a.periodfrom - a.periodto
      For Each Record
           Do
           D - Add a Bulk Upsert Row
           Bulk Record set = B Bulk Record Set
           Related Invoice = c.related_invoice
           Record ID# = c.id
      E. Commit Upsert



      ------------------------------
      Ryan Locke
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        When you add a bulk upsert  row you want to grab the Record ID of step A which is the trigger record and out that in Related Invoice.  I think that will show up as just ID on the field list.  So when you build the bulk upsert rows, some of the fields will be populated from step A and some from the search step.

        Related Invoice = {a.id}

        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------