3

I have linked my lightning component with Quick action button, my requirement is I want to open lightning component in a new window. How should I achieve this

  • new browser tab window or as new tab in service console App? – sdandamud1 Aug 5 '19 at 14:45
  • new browser tab window – Jill_sfdc Aug 6 '19 at 6:14
5

You should consider using lightning:navigation.

Target component

should implement lightning:isUrlAddressable

<aura:component implements="lightning:isUrlAddressable" access="global" >
Test
</aura:component>

Add to your quick action component

<lightning:navigation aura:id="navService"/>

And how to navigate from your quick action controller

        var pageReference = {
            type: 'standard__component',
            attributes: {
                componentName: 'c__helloTarget',
            },
            state: {
                "c__firstname": "John"
            }
        };

        var navService = component.find("navService");
        event.preventDefault();
        navService.navigate(pageReference);

This code directs you to /lightning/cmp/c__helloTarget?c__firstname=John

| improve this answer | |
0

You can create a detail page button with URL:

enter image description here

URL:

/lightning/cmp/c__MyCompName?c__att1=some_value

When you add this to record page layout, it will open component directly. You can also add parameters (all parameters should start with c__). Your component can read parameters through state in isUrlAddressable.

Note: This is URL hack and will work as long as URLs template dont change.

| improve this answer | |
  • This opens in same window not in a new browser tab window. – Jill_sfdc Aug 6 '19 at 10:09
  • Yes true. I think this is maximum we can get upto if we dont want to see the quick action modal. If you can use quick action, you get generated URL from page reference and use window.open(URL,'_blank') – salesforce-sas Aug 6 '19 at 10:15
  • @salesforce-sas I am trying to achieve something similar here salesforce.stackexchange.com/questions/302538/… can you please help me what I am missing – user81642 Apr 15 at 2:12

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.