Jump to content
  • 1

Adding a second record for the same ID to a Table using a Trigger



I am trying to add via an Insert trigger a second row of data, based on the first row of data which is inserted by a trigger associated with another table.

The Awards table has an start date and end date of the project, and on insert creates the first milestone in a Milestone table,  based on the entered start and end dates for the Award.

On insert of the first milestone, I would like to add (if at all possible) a second milestone if the remaining period for the period is bigger than 12 months (which is calculated in a formula field in the first record).

I get a "Triggered Action cannot be enabled because it exceeds maximum nested level of 1" Error message.

Any help appreciated


Trigger Action to add 2nd Milestone.JPG

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Howdy Vander.  I would suggest adding the InsertAction shown here as a second action of the awards table trigger.  This way you aren't cascading triggers, it's all done in one place.

Question, are you trying the Milestones to the Awards?  If yes that might create some challenges but there are solutions for that also.  I hope that helps.

Link to comment
Share on other sites

  • 0

Thanks Brasovan,

your comment put me in the right direction.

I have created a multi-step trigger on the Awards table which generates the financial milestones for up to 6 years, and any shorter period in between, based on a set of IF statements and a calculated value of the next financial year end (and start of the next one); the budgets are attributed based on the total award divided by the  number of months of the project duration.

Link to comment
Share on other sites

  • 0

From what it looks, it is not a cascading issue but a recursion error. 

Your current trigger is set to run on insert. This means that it will run when a record is inserted on your parent table which is the 'T_PA_Milestones'. However, you have an insert block your trigger that insert records to your parent table.  Cases like this are not possible since it will cause a self recursion or infinite loop. 


Link to comment
Share on other sites

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.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...