.ultrageek. Computers, Music, and Thoughts

3Jul/190

Apex Class working with both Trigger and Batch

Sometimes there is a need for a class to execute based on a record value (checkbox) or as part of a scheduled batch job. Not a new concept but you will get this error: Static method cannot be referenced from a non static context

So a quick fix is to just create a non-static method that calls the static method...crazy that this works but it does.

Again - nothing magical or new here but in case google was not giving you the results here is one solution.

 

Tagged as: Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.