You need to sign in to do that
Don't have an account?
Yogesh Kulkarni
Change RunAs user from javascript call
Hi,
Can I change the current user for execution of some lines of code while using javascript behind detail button? I normally do this using System.RunAs in apex.
Thanks,
Yogesh
Can I change the current user for execution of some lines of code while using javascript behind detail button? I normally do this using System.RunAs in apex.
Thanks,
Yogesh
All Answers
too bad you can't do that. Only intended for Unit tests.
But what are you trying to accomplish ?
Do you have troubles with sharing rules? you can fix that with the Without sharing keyword.
Ownership of records? can also be done with apex code
And if it is something completly different, you can solve that with a batch job running as another user.
I wanted to run a code as different user as logged in users are not permitted to few changes. I wanted to bypass that by using a user login who has permission. Now I accomplished that using separate VF page and carrying transaction in the controller code and bypassing validation using flags in code.
Thanks for your reply.
Regards,
Yogesh