Below is my lightning cmp

<aura:component implements="force:lightningQuickAction" access="global">
<iframe src="sforce.one.navigateToURL('/apex/Letter?Id={!Letter__c.Id}')" width="100%" height="500px;" frameBorder="0"/>

My Letter VF page renders a PDF which is based on ID hence I have written Id={!Letter__c.Id} to get the data from there for the PDF generation

I'm unable to save the cmp as I got the error Cannot mix expression and literal string in attribute value, try rewriting like {!'foo' + v.bar}: Source

Hence, I have changed my code to

<aura:component implements="force:lightningQuickAction" access="global">
<iframe src="sforce.one.navigateToURL('/apex/Letter'? + v.Id={!Letter__c.Id})" width="100%" height="500px;" frameBorder="0"/>

But still i'm facing the same problem


When using merge syntax, the format must be exactly:


You cannot have the merge syntax anywhere else:


As such, you would need to write your attribute as follows:


However, this also won't work, because you can't run JavaScript in a src attribute, since this would be blocked. Instead, you'd need to do whatever JavaScript you intended to use in the controller.

  • To get the URL in print format the used is window.print(url). I have used this function in controller to get the URL in print format but it is still displaying in the pdf format only. Can tell me why it's happening like that? – sf123 Jul 23 '18 at 14:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.