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
TeraMcTeraMc 

Trigger: Update Opportunity field with Open Activity Due Date

I am running an Enterprise Edition trial for a client. We do not have a sandbox, so I am very wary of implementing a trigger as there is no place to test it.

 

I have a custom field called "Follow up date" on the opportunity object. When an open activity is created, I would like a trigger to update the Follow up date to be the due date of the activity. If there is more than one activity, I would like it to be the next upcoming due date.

 

If anyone has links to examples of a trigger like this, I would appreciate the help.

 

Thank you.

MMA_FORCEMMA_FORCE

You Can do this...Hope this Helps

 

trigger OppUpdate Opportunity (before insert, before update) { List<Opportunity> opptoupdate = new List<Opportunity>(); for(Opportunity opp: trigger.new) { if(opp.Follow_Update__c=='something'){ opp.whateverfield = 'Hello'; } opptoupdate.add(opp); } }