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
SFDC_dreamforce2010SFDC_dreamforce2010 

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!

Ispita_NavatarIspita_Navatar

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.

SFDC_dreamforce2010SFDC_dreamforce2010

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!