I have scenario like calling a lightning component from VF page. Once value updated in lightning component the value should be update in VF page.

I have used 'window.opener.location.href' in lightning client side controller to redirect to VF page from lightning component. But this event is blocked in lightning.

I have tried another approach in lightning component like:

"<a href="!javascript:top.window.opener.closeCampaignLookup('{!a.id}','','','')">{!acc.Name}</a>"

But could not save lightning component, since getting error like "Cannot mix expression and literal string in attribute value, try rewriting like {!'foo' + v.bar}: " Please help me on this.

  • did you find any solution, i have come across the same situation Sep 3 '18 at 18:52

Have you tried to use sforce.one.navigateToURL("/apex/VisualForcePageXYZ?id=" + '{!a.Id}') to redirect to Visualforce page or sforce.one.navigateToSObject('{!a.Id}', 'detail') to redirect to standard detail page.

Lightning mode is detected (sforce.one != undefined). For example:

if(sforce.one != undefined) {
 sforce.one.navigateToURL('/apex/VisualForcePageXYZ?id=' + '{!a.Id}');

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.