You need to sign in to do that
Don't have an account?
Starz26
Apex in System Mode and getContentAsPDF for Visualforce Security
If Apex runs in system mode, then why does getContentasPDF() not work if the user does not have access to the VF page.
I want to control when a page is generated via code. Because of the above, In order to do so I have to give the users access to the VF page and thus they can generate it anytime as long as they know the pagename and how to construct the url.....
Can you please elaborate .
Starz26,
Did you check whether the controller of the your visualforce page also runs in system mode.
Ahh, rookie move. A contractor did some of the code and used WITH SHARING. However I have removed that and still same error.
I will have to do some digging to ensure there is nothing elses blocking it..
Seems the problem with security access(Field or Object level security).
Try running the page for which you are performing getContentAsPdf for the user your getting error. And also ensure if the user is trying to access the records for which he is not having permissions.