0

Is it always system context, or it depends on where the method is called?

  • 1
    It runs in the context of user who initiated that async method. – Pranay Jaiswal Jun 12 '18 at 16:03
2

It doesn't matter where it's called from, but it does matter if you specify "with sharing." If you specify "with sharing," then sharing is enforced. If you do not specify a sharing mode, or you specify "without sharing," it runs in system context.

  • Wait, I think I misunderstood. The sharing setting matters on where it is called, or on the class where the method is? – Renato Oliveira Jun 12 '18 at 17:36
  • 1
    @RenatoOliveira The Scheduled class itself, not wherever it's called from. – sfdcfox Jun 12 '18 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.