I create headless quick action "Generate and attach pdf". But when i click on my action i have error "List has no rows for assignment to SObject". What is my problem?
How i can fix it?
I create headless quick action "Generate and attach pdf". But when i click on my action i have error "List has no rows for assignment to SObject". What is my problem?
How i can fix it?
This may be probably due to the fact that recordId
is undefined in connectedCallback()
as I can see the value logged in console is undefined
. When using headless quick actions, implement invoke()
method to read the recordId
and then trigger any Apex controller actions. You can find more details here.
Thanks !
getContentAsPdf()
doesn't work in lightning context. It fails silently. Workaround is you can replace getContentAsPdf()
with getContent()
and fill the attachment record field ContentType
with value as application/pdf
Commented
Feb 4, 2022 at 15:48