NirajShah
7 years agoQrew Cadet
Automation to add one record to another table when something is triggered in another table
I have three tables: Purchase Orders, Cost Sheets, and Entries. The relationship is such that a Purchase Order can have multiple entries and Cost Sheets can have multiple entries. I have an "Approval" button on the Cost Sheets table, when triggered, automatically approves all entries associated with that cost sheet.
On the entries table, users are required to select a Vendor for each entry. Each entry is associated with a Cost Sheet, such that one cost sheet may have anywhere from 1 to infinite number of entries that may also belong to 1 to infinite number of vendors.
The challenge I am having is how to automatically generate a purchase order for each __unique __vendor when a cost sheet (and entries) are approved. Currently, the automation fails since the related vendor field is required to be unique, and once I remove that requirement, the automation runs but creates multiple purchase orders for the same vendor.
On the entries table, users are required to select a Vendor for each entry. Each entry is associated with a Cost Sheet, such that one cost sheet may have anywhere from 1 to infinite number of entries that may also belong to 1 to infinite number of vendors.
The challenge I am having is how to automatically generate a purchase order for each __unique __vendor when a cost sheet (and entries) are approved. Currently, the automation fails since the related vendor field is required to be unique, and once I remove that requirement, the automation runs but creates multiple purchase orders for the same vendor.