I would really appreciate if someone could help me with the following script:
I have a table called VARIABLES with certain costs {variable_name} and the possibility to assign to a cost concept different groups of assets {variable_groups}
Then I have a second table called ASSETS for entering assets, where I always assign one group to each asset being entered.
And I finally have a third table called COSTS connected to ASSETS in a one asset_id to many cost_id relationship with a field called {Cost name} that Links to the field called {variable_name} in VARIABLES.
I need a script to be triggered when a new record is entered in ASSETS that:
- Reads the group to which this asset belongs {Group},
- Checks in VARIABLES what costs {variable_name} have this group assigned in {variable_groups}
- Creates in COSTS one record for each {variable_name} that has this {Group} assigned.
In the example for {Group}= “Vehicles”, we can see how it creates 6 records in COSTS connected to the asset_id just entered in ASSETS, one for each of the 6 {variable_name} in VARIABLES that has “Vehicles” in {variable_groups}.
Thank you so much for your kind assistance.