function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mlindsaymlindsay 

Oppurtunity Trigger

I need to have a trigger that updates a date field on our opportunity page when an opportunity stage is changed.

The field I need to update with the date is called "Current Stage Date"

I tried doing it with a workflow but it updates the date everything the opportunity reocord is edited.

I have never written a trigger so any help would be great!

Thanks,

Michael

 

Best Answer chosen by Admin (Salesforce Developers) 
bouscalbouscal
Use the following as a workflow rule;

ISCHANGED(StageName)

Have it fire your field update to set the Current Stage Date to NOW()