You need to sign in to do that
Don't have an account?
Matt Czugala
Creating 1st Trigger - Tasks Object
We have recently started using a plugin to automatically log calls when a call is received. A small nuance we have noticed is that it logs the call even if the sales rep is not at their desk to answer the call. This has resulted in thousands of tasks being unncessarily created. So I am wanting to create a trigger to automatically delete one of these tasks once it has been created.
I just created a sandbox so that I start working this, but is there a how-to I can follow to try and complete this? I know the criteria I need to match against so as long as the coding is similar to VB or SQL I should be able to complete.
Thanks!
I just created a sandbox so that I start working this, but is there a how-to I can follow to try and complete this? I know the criteria I need to match against so as long as the coding is similar to VB or SQL I should be able to complete.
Thanks!
I have a blog post that can get you started. Read through it and poke me back here if you have questions! Good luck!
http://techman97.wordpress.com/2012/07/18/how-to-write-a-basic-apex-trigger/
Thank you.
I keep getting the following error:Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger DeleteBadLoggedCalls caused an unexpected exception, contact your administrator: DeleteBadLoggedCalls: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.DeleteBadLoggedCalls: line 4, column 1
In the "insert" context, there is not a "trigger.old", only a "trigger.new". =)
You can split up the logic to something like:
http://techman97.wordpress.com/2012/07/18/how-to-write-a-basic-apex-trigger/
-Andy