Reply
Regular Contributor
SFDC_dreamforce2010
Posts: 12

Opportunity Field Update

Hi,

 

I am trying to figure out the best way to add a field to already approved opportunites. There was a formula field which we plan to replace with a before insert,before update trigger.

 

The problem is that, the trigger calculates the values only on insert and update and we have opportunites which are approved and locked and we want to update them too with the new values calculated by the trigger.

 

I appreciate your feedback.

 

Thanks!

Super Contributor
Ispita_Navatar
Posts: 1,055

Re: Opportunity Field Update

For updating already approved opportunities probably you can do the following:-

 

1. Do a silent update on these opportunity using SOQL via system log, that would fire the trigger.

 

2. Alternatively whatever your trigger is doing can also be done via an Apex code snippet and that can be executed via scheduleable apex .

 

But what is crucial  is does the locking of opportunity prevent further DML statements.

 

Hope this helps.

SE
Navatar Group
Regular Contributor
SFDC_dreamforce2010
Posts: 12

Re: Opportunity Field Update

Hi Ispita,

 

Thanks for your response.

 

The trigger is calculating the value based on certain criteria and the opportunites that are approved are locked so can i do an update on these opportunites using SOQL or apex code snippet.

 

Thanks!