Line items from an estimate to a project

  • 0
  • 3
  • Question
  • Updated 1 year ago
  • In Progress
I have a table called estimates that has a one to many relationship with a table called items. This allows our project managers to add line items when they are quoting an estimate. I want to have a table called Projects that takes the information from an estimate and turns it into essentially a work order. I have been able to populate the Projects with all the information that I need from an estimate, however, I cannot get the items from the estimate to the related projects. Any help is greatly appreciated.
Photo of Justin Pauga

Justin Pauga

  • 390 Points 250 badge 2x thumb

Posted 1 year ago

  • 0
  • 3
Photo of Matthew Neil

Matthew Neil

  • 31,678 Points 20k badge 2x thumb
If you wanted to go with a 100% native option, you could use a combination of API edit buttons, and quick base 'actions' to edit the existing line items, and connect them to the newly 'won' project.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,024 Points 20k badge 2x thumb
You want to use the method API_CopyMasterDetials which is documented here.

https://help.quickbase.com/api-guide/index.html#api_copymasterdetail.html

API_CopyMasterDeails copies related records in the identified tables in one fell swoop. Other than assigning appropriate values to the foreign key fields (eg [Related Parent]) it does not modify any other field values during the process. The method API_CopyMasterDeails  is probably underutilized as it takes a little more planning to map out what tables are participating and how to set the parameters.

Another approach which is even more versatile is to use script with multiple API methods such as API_DoQuery, API_AddRecord, API_ImportFromCSV and additional logic in the script to initialize, increment or otherwise calculate values for some of the fields being created. If you want counters, periodic dates, "one of each item in a list"  or other calculated fields this is the method to use.
(Edited)