You need to sign in to do that
Don't have an account?
Garrett Samuels
Apex class or trigger to update Opportunity Last Modified Date when related Task or Event is updated/created
I have a requirement to have the Opportunity record Last Modified Date update when a related task or event is created/updated. I am looking for advice on how to achieve this. Is this possible through an Apex Class or Trigger? Please advise.
Garrett,
This would be possible with a trigger. something like an after update/insert/delete trigger that had some code like this:
This iterates through the tasks in a trigger and checks the "WhatId" field to see if it's linked to an Opportunity. Any Opportunities linked to a Task in this trigger will be updated.
Andy
Thank you for your response. I created the Trigger in Sandbox Developer Console. One thing I noticed was in Developer Console the Problems tab resulted in a row that states Problem: "unexpected token: list". That said, I saved the trigger (on Task sObject). Then I went to an opportunity that was last modified on 3/7/15. I added a related task to the opportunity then checked the opportunity last modified date and it did not change. What do you think is the next step? Thank you again.
Garrett