Uses: In Lightning Create a Quick Action and call the lightning component in which aura handler call the controller and in controller use java script function Window.open('/', '_blank').
Lightning component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="recordId" type="String" />
<aura:handler name="init" value="{!this}" action="{!c.openNewWindow}"/>
</aura:component>
Controller:
({
openNewWindow : function(component, event, helper) {
var recordId= component.get('v.recordId');
// Close the action panel
var dismissActionPanel = $A.get("e.force:closeQuickAction");
dismissActionPanel.fire();
window.open('/apex/VF_Page?id='+recordId,'_blank');
}
})
Lightning component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="recordId" type="String" />
<aura:handler name="init" value="{!this}" action="{!c.openNewWindow}"/>
</aura:component>
Controller:
({
openNewWindow : function(component, event, helper) {
var recordId= component.get('v.recordId');
// Close the action panel
var dismissActionPanel = $A.get("e.force:closeQuickAction");
dismissActionPanel.fire();
window.open('/apex/VF_Page?id='+recordId,'_blank');
}
})
No comments:
Post a Comment