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

Batch Apex - execute it from different user than the one submitted it
Hi,
Is it possible to assign a different contextual user to the batch apex than the one who has submitted it? If yes, can someone please provide an example.
Thanks much.
No. Batch Apex will run as the current user. You should take this into consideration if you have validation rules, etc that might cause problems because of this. The only time you can alter the current running user is when running unit tests, which will not assist you in this case.
Edit: But it is running in system mode, which means that object level and field level security pose no threat. Just validations and triggers.
All Answers
No. Batch Apex will run as the current user. You should take this into consideration if you have validation rules, etc that might cause problems because of this. The only time you can alter the current running user is when running unit tests, which will not assist you in this case.
Edit: But it is running in system mode, which means that object level and field level security pose no threat. Just validations and triggers.
No, it is not possible to assign the batch to a different user at the moment.
- A