You need to sign in to do that
Don't have an account?

Trigger.new on before Triggers: need clarification
hello,
I am confused with what values the Trigger.new should contain during a trigger on before Update or before Insert.
I have a trigger on Case object:
trigger limitHighPriorityCases on Case (before insert,before update) { for (Case c : Trigger.new) { if ( (c.Priority == 'High') && (c.IsClosed == FALSE) ) { //some code
} } }
When I update a case with Closed status, the IF loop is executed, which I don't really understand since Trigger.new is supposed to conatin the new version of the case, therefore IsClosed should be equal to TRUE and the IF loop souldn't execute.
Could someone clarify?
Thank you
Marc
It seems the IsClosed standard field is only being set by an internal workflow of some sort, since the value is properly updated during the After trigger.
So if you need to update the Case, you're unfortunately going to have to check based on the actual value. However, if you are updating other objects, using an after trigger would help....
All Answers
It seems the IsClosed standard field is only being set by an internal workflow of some sort, since the value is properly updated during the After trigger.
So if you need to update the Case, you're unfortunately going to have to check based on the actual value. However, if you are updating other objects, using an after trigger would help....
You're right. I checked on the picklist value of the Status field and it works great now.