I'm trying to create a trigger so that when the field CCTAproject_id in my parent table "tbl_projects" is updated, rows will be created in all of my related tables and given the same CCTAproject_id. I only want this to happen once (due to the way I set up the new submission form, it generates a random string and then the client will update this field once to assign it a new ID number). However, whenever I update any field in that same record in the parent table, it creates another record in the related tables. Ex, I update different fields for one record three different times and three blank cells with that same ID are generated.
I thought of creating a workflow that If the CCTAproject_id doesn't exist, then add the new record. When I tried dragging in the If/Then operator, it did not give me any fields or tables as options to select from. Is there another workaround to add the record only once to my related tables?
My update forms are split between many related tables, which are all linked through CCTAproject_id. When a new project is added, that records only gets added to the parent table, not the related tables, thus the need for this trigger.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
PlaceWorks
I'm trying to create a trigger so that when the field CCTAproject_id in my parent table "tbl_projects" is updated, rows will be created in all of my related tables and given the same CCTAproject_id. I only want this to happen once (due to the way I set up the new submission form, it generates a random string and then the client will update this field once to assign it a new ID number). However, whenever I update any field in that same record in the parent table, it creates another record in the related tables. Ex, I update different fields for one record three different times and three blank cells with that same ID are generated.
I thought of creating a workflow that If the CCTAproject_id doesn't exist, then add the new record. When I tried dragging in the If/Then operator, it did not give me any fields or tables as options to select from. Is there another workaround to add the record only once to my related tables?
My update forms are split between many related tables, which are all linked through CCTAproject_id. When a new project is added, that records only gets added to the parent table, not the related tables, thus the need for this trigger.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.