+ Start a Discussion
garybgaryb 

Workflow/Roll up summary changes in Spring 09

Hi all,

 

Is anyone else out there trying to get their head around the changes made to workflow and roll up summary field evaluations updated made in Spring 09?

 

From what I can understand, it's just the evaluation of workflow and RUS fields that are affected - triggers may still run multiple times. The reason I ask is that we have some code that will perform some actions, after which the workflow will fire and we may need to perform more actions depending on changes made by the workflow. From my understanding, this has not been broken. What are other people's opinions? Have I misunderstood?

 

There's a example (currently) given on page 82 of the spring 09 release notes. I think something was missed out of the example - the apex trigger that creates the opportunity has some logic so that it only creates one and only one opportunity (for example, some sort of static variable). Otherwise, I'm unsure why, when the roll up summary increases, another opportunity is not created. From my testing, the trigger will fire again but not the workflow (which seems to be the thrust of this update).

 

That should be enough to get the ball rolling... Thanks in advance for your help!

Venkat PolisettVenkat Polisett

You are right. I would invoke the after update trigger once again after the update of rollup summary field.

 

I would right the trigger & work flow some thing like this:

TRIGGER:after insert, after update (psuedo code)

======= 

if (Trigger.Issert && Trigger.New[x].amount > 1 million) -- insert opportunity if (Trigger.Isupdate &&

Trigger.new[x].amount > 1 million &&

Trigger.new[x].amount != Trigger.old[x].amount)

-- insert opportunity

 

 

In the same way, in a workflow rule criteria, one should check the current value as well as the prior value. 

 

 

That way, it should work whether you have that critical update or not.

 

My 2 cents.