Forum Discussion

EmberKrumwied's avatar
EmberKrumwied
Qrew Assistant Captain
2 months ago
Solved

Filter records based on table connection

Not sure if the title exactly describes what I am trying to achieve, but here is what I'm working on. I am trying to create a simple-ish application for one of my teams where they can track projects...
  • EmberKrumwied's avatar
    31 days ago

    Never mind...I found a work around. Posting what I did in case it might help others.

    I added a checkbox to the Projects table.  Then created a pipeline to trigger when an Invoice record was updated and the "Create new Invoice" box is checked.

    Step 1 - The pipeline then creates a new Invoice and populates the Related Project ID with the Record ID of the Project.

    Step 2 - Then updates the Project record to remove the check.

    Step 3 - It then searches my Time Entries table looking for any records where the Related Project ID matches AND the Related Invoices field is empty.

    Step 4 - For each it finds, it updates the Related Invoice ID field with the record ID of the newly created Invoice in Step 1.

    Voila, I now have one or more (as it seems to work whether I select 1 or more Projects to create invoices) Invoices created and they are linked to the appropriate Time Entry.  Bonus, if I delete the Related Invoice ID from a Time Entry, it will get picked up on the next round of Invoice creations.

    Not sure if this is the best or most efficient way, but for now it works.