MikeTamoush
3 years agoQrew Commander
Need to auo create records, must be a better way than my idea
I have a Projects table with two dates (Start/End).
I have a subcontractors child table (usually around 10 subcontractors per project).
I want to trigger a Pipeline that creates entries in a 3rd table (which is a child to both). The entries will be - one entry per month per subcontractor between the two dates. For example, if start date is 1/1/21 and end date is 12/31/21, I want it to create entries for February, March, April, Etc (a date field on the entry can simply be dated 2/1/21, 3/1/21, and so on. Ill probably include the first and last month but that is moot, I can control that with >= formulas).
The trick: If the dates are changed I want the Pipeline to add on any more months now needed (deleting is probably unnecessary as I can filter out unnecessary months on reports).
The second trick: I cannot have my pipeline delete all the entries and recreate them if a date is changed. I need the Pipeline to search for what exists, and create the missing ones.
Where I currently can do:
I already have a formula field which makes a text list of all the missing months (what dates still need to be created). I thought this might be helpful but haven't figured out a way to incorporate it. I thought maybe I could make yet another table that just simple has month dates listed for the next decade, and somehow use that in a loop, but I still can't come up with how I would utilize it.
I have figured out one way but it involves triggering the pipeline over and over again. I thought if I have 10 subcontractors on a 2 year project, that would trigger the pipeline 240 times in a row and I thought that would use too many resources, but not sure if that is true?
Ideas?
------------------------------
Mike Tamoush
------------------------------
I have a subcontractors child table (usually around 10 subcontractors per project).
I want to trigger a Pipeline that creates entries in a 3rd table (which is a child to both). The entries will be - one entry per month per subcontractor between the two dates. For example, if start date is 1/1/21 and end date is 12/31/21, I want it to create entries for February, March, April, Etc (a date field on the entry can simply be dated 2/1/21, 3/1/21, and so on. Ill probably include the first and last month but that is moot, I can control that with >= formulas).
The trick: If the dates are changed I want the Pipeline to add on any more months now needed (deleting is probably unnecessary as I can filter out unnecessary months on reports).
The second trick: I cannot have my pipeline delete all the entries and recreate them if a date is changed. I need the Pipeline to search for what exists, and create the missing ones.
Where I currently can do:
I already have a formula field which makes a text list of all the missing months (what dates still need to be created). I thought this might be helpful but haven't figured out a way to incorporate it. I thought maybe I could make yet another table that just simple has month dates listed for the next decade, and somehow use that in a loop, but I still can't come up with how I would utilize it.
I have figured out one way but it involves triggering the pipeline over and over again. I thought if I have 10 subcontractors on a 2 year project, that would trigger the pipeline 240 times in a row and I thought that would use too many resources, but not sure if that is true?
Ideas?
------------------------------
Mike Tamoush
------------------------------