Timeline for Relating a task when an opportunity is updated. Before or After Update trigger?
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 26, 2015 at 19:53 | vote | accept | Mayank Srivastava | ||
Mar 26, 2015 at 19:53 | |||||
Mar 26, 2015 at 16:06 | comment | added | crmprogdev | Before Update triggers fire before a record is Updated. They don't necessarily require the record to be Updated for them to be successful. They do their work and then the next (if any) trigger fires. As I understand it, "it depends" on how the record update occurs as to whether or not anything else will be rolled back or not. Usually a Before trigger operates on trigger.new. In your case, it creates a record on a different object. | |
Mar 26, 2015 at 16:00 | comment | added | Mayank Srivastava | I don't understand how that could happen. If the record fails to update, how will it create a new task? I did what you suggested (made the update fail by inserting a string into the Amount field) and a new task wasn't created. Please see the code in my edited OP. Also, any input on how to improve this or bulkify it will be much appreciated =) | |
Mar 26, 2015 at 15:43 | history | answered | crmprogdev | CC BY-SA 3.0 |