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

converting a JS button to a lightning quick action that initializes a do i get it just to run the JS controller?

Here's the original JS button''+'{!$User.EmployeeNumber}');

Here's my lightning controller
goToUrl : function(component, event, helper) {
    var urlEvent = $A.get("e.force:navigateToURL");
    var userId = A.get("$SObjectType.CurrentUser.Id");
      "url": "" + userId, 
       "isredirect": "true"

Now all i want is a lightning quick action to make ^ above what do i put in my component portion to make that happen...
<aura:component implements="force:lightningQuickAction" >
    <aura:attribute name="onclick" type="Aura.Action" default="{!c.goToUrl}" />    


Would that work? It's not really doing any server calls...right? From what i understand the JS doing the A.get on the ("$SObjectType.CurrentUser.Id") is getting the current user without having to directly call the server to get the id. Does the client hold onto their user record while using sfdc? could i do Id.EmployeeNumber__c ?
Maharajan CMaharajan C

You have to use the init function in aura:handler. Like below.

<aura:component implements="force:lightningQuickAction" >
​    <aura:handler name="init" value="{!this}" action="{!c.goToUrl}"/>​​​​​​