+ Start a Discussion
zhengyanzhengyan 

A trigger question

I read the apex developer's guide and at  the bulk trigger part found this "

The code block of a trigger cannot contain the static keyword.Triggers can only contain keywords applicable to an inner
class."

what does this mean?

 

AcMEGXAcMEGX

It refers to the word "static"

 

you cannot write static functions/variables within triggers. The ff. example will produce a compile error...

 

 

trigger accountTrigger on Account (before insert) 
{
    static String strValue;
}