function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pramodh KumarPramodh Kumar 

Could not able to open same action in the Lightning quick actions

I have a requirement in the lightning quick actions. When I click on the action it should open in a new window, 
 
The Problem is for the first time it is working absolutely fine. but for the next time if want to use the same action again. I could not able to do.

The lightning component I used here is 

Here is Code.
({
    doInit : function(component) {
        var recordId =component.get("v.recordId")
         urlEvent.setParams({
          "url": '/'+url
        });
        urlEvent.fire();
	}
})


Thanks
 
Best Answer chosen by Pramodh Kumar
Pramodh KumarPramodh Kumar
Here the problem is not with the code. For the Case object Salesforce redesigned everything from the scratch. The lightning QuickActions will appear in the publisher component, not in the buttons component. Here is the best approach we came up. Please let me know if you any other approach.


User-added image


Thanks
pRAMODH.

All Answers

Amit Singh 1Amit Singh 1
Hi Promodh,

In your js function, you are using URL for redirecting to that Url but have not defined to which URL u want to redirect. Also, You are setting the parameter to urlEvent but for which object you are trying to set the parameters.

I have made some modification which is given below:
({
    doInit : function(component) {
        var recordId =component.get("v.recordId");
        var url = Your_Url_Here;
        var urlEvent = $A.get("e.force:navigateToURL");
         urlEvent.setParams({
          "url": '/'+url
        });
        urlEvent.fire();
	}
})

Let me know if this makes sense :)

Thanks,
Amit Singh
Pramodh KumarPramodh Kumar
I only kept the part of code. This is what I wrote in my code.

The problem is when I click it is working for the first time. but not for the second time.
doInit : function(component) {
        var recordId =component.get("v.recordId")
        var URL1 =  $A.get("$Label.c.Update_related_transaction_information_lable_1");
        var URL2 = $A.get("$Label.c.Update_related_transaction_information_lable_2");
        var url = URL1 + recordId + URL2;
        var urlEvent = $A.get("e.force:navigateToURL");
         urlEvent.setParams({
          "url": url
        });
        urlEvent.fire();
	}

 
Greg_ThomsonGreg_Thomson
pRAMODH,

You can fall back to normal javascript and open a new window on action click with:
 
window.open("URL_GOES_HERE", "_blank");

This will likely trigger your browser popup blocker, but that can easily be disabled.  

Greg Thomson
Pramodh KumarPramodh Kumar
Here the problem is not with the code. For the Case object Salesforce redesigned everything from the scratch. The lightning QuickActions will appear in the publisher component, not in the buttons component. Here is the best approach we came up. Please let me know if you any other approach.


User-added image


Thanks
pRAMODH.
This was selected as the best answer
lavanya mulpurilavanya mulpuri

Hi Pramodh Kumar,

I have a similar requirement, to navigate to a different component in a new Tab. 
Here's a code snippet. Can you please provide me a work around

var evt = $A.get("e.force:navigateToComponent");
        evt.setParams({
            componentDef : "c:myComponent",
            componentAttributes: { recordId : component.get("v.recordId") }
        });
        evt.fire();

Thanks in advance! :)