Wednesday, June 1, 2016

Developer:Error: Compile Error: Loop variable must be of type SObject

Our environment had implemented seperation of concerns and so the logic for triggers was in helper classes.

When trying to access trigger.new in helper classes; the context is not available automatically, you have to explicitly pass these attributes to your helper classes.

So, ClassName.MethodName(Trigger.New) should be used to call your class and explicitly pass the trigger collections.

No comments:

Post a Comment