You need to sign in to do that
Don't have an account?
enossir
converting a JS button to a lightning quick action that initializes a component...how do i get it just to run the JS controller?
Here's the original JS button
Here's my lightning controller
Now all i want is a lightning quick action to make ^ above run......so what do i put in my component portion to make that happen...
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 ?
window.open('https://tool.rss.igt.com/RSSTool/CheckSAPLicense?PERSNO='+'{!$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"); urlEvent.setParams({ "url": "https://tool.rss.igt.com/RSSTool/CheckSAPLicense?PERSNO=" + userId, "isredirect": "true" }); urlEvent.fire(); } })
Now all i want is a lightning quick action to make ^ above run......so 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}" /> </aura:component>
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 ?
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}"/>
</aura:component>
Thanks.
Maharajan.C