+ Start a Discussion
Niraj Shrikhande 15Niraj Shrikhande 15 

System.isBatch and Managed Package

I have a managed package installed that starts a Batch job. In my custom code I have implemented a Future method. When the batch job starts it updates my object and invokes the trigger that calls the future method. I would like to call the Future method only when its a normal operation and not a Batch operation. I  intend to use the System.isBatch() property to determine whether its a Batch operation. Since the Batch job is in the managed package I am not sure whether the variable will return a "True" value in my custom code. Has anyone encountered such an case ?

System.isBatch is a context method, and as such it should work just fine, regardless of the namespace (package) that invoked the code. Using the system.isBatch() method is exactly how I'd do this.
Niraj Shrikhande 15Niraj Shrikhande 15
Thanks Kevin, I will give it a shot.