I have a Visualforce page that is used to generate a PDF document by our users. Recently we started experimenting with the Community License, and I'm facing an unusual error with this user.

The profile allows the user to access the Visualforce page, and when he does using the browser (navigating to community/apex/page?id=<record id> it works just fine, and the document is shown).

I do have a button on the record's detail page that is used to call a webservice that is using the getContentAsPDF() method. When the user tries to use this button to get the PDF saved as an attachment, the button fails with the "Map key null not found in map" error.

I've observed that I can get the PDF saved if I comment certain parts of the page, but this means commenting 80%+ of the page's content. Also, while the PDF file is saved, the content that is shown is all empty (like if the record isn't retrieved or the user doesn't have access to read it, which doesn't make sense since the user can access the page directly).

I think this should be treated as a bug. But I want to make sure if others have had the same issue.

  • what is happening when you open page as is, without get content but in browser? – kurunve Nov 14 '17 at 14:49
  • The page loads perfectly fine when accessing through the browser. – Renato Oliveira Nov 14 '17 at 14:53
  • and if you open that as community user? – kurunve Nov 14 '17 at 16:26
  • Same thing. The community user seems to be able to access the visualforce's pdf normally, but when the system is retrieving the PDF using the PageReference's method as I mentioned, the error shows up. – Renato Oliveira Nov 14 '17 at 17:40

Your Answer

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

Browse other questions tagged or ask your own question.