I am implementing apex scheduler, i wondering how can i change Run User As to some one else. Presently it is taking current User.
Thanks in advance.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityYou'll need to schedule the job as the appropriate user in terms of whoever is actually executing the code (whether it is via some sort of Visualforce UI or the user scheduling the Apex Job via the UI). The System.RunAs functionality only exists in unit tests.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_tools_runas.htm