You need to sign in to do that
Don't have an account?
Monin Savant
Preview pdf file from lwc
Hello!
I want to preview pdf file from lwc component. I get the id of all files that refer to the record, but when I click on the button, I get the message
"Error in $A.getCallback() [Cannot read properties of undefined (reading 'errors')]". Why
My JS file
Thanks in advance!
I want to preview pdf file from lwc component. I get the id of all files that refer to the record, but when I click on the button, I get the message
"Error in $A.getCallback() [Cannot read properties of undefined (reading 'errors')]". Why
My JS file
previewHandler() { this[NavigationMixin.Navigate]({ type: 'standard__namedPage', attributes: { pageName: 'filePreview' }, state : { recordIds: this.files, selectedRecordId: this.files[0] } }) }
Thanks in advance!
https://www.salesforcetroop.com/file_preview_lwc
Thanks!
All Answers
https://www.salesforcetroop.com/file_preview_lwc
Thanks!
Please follow below url:-
https://developer.salesforce.com/blogs/2019/07/display-pdf-files-with-lightning-web-components
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Monin Savant,
It's too late to answer but it can helps other folks.
We don't need to use '_blank' or window.open because <a></a> tag will automatically redirect you on the new page