URL to call lightning component with parameter in salesforce1 using custom button or link

i want to call lightning component with parameter in salesforce1 using custom button or link. How can i achieve this ?

Answer

As of the beta release in Spring 15, the following are the only ways to use custom lightning components in the Salesforce1 Mobile Application.

  • A custom tab of type Lightning Component
  • A custom tab of type Lightning App which has a set of lightning components on it

The first is well documented in the Lightning Component Developer guide.

The second will be beta soon, and you should follow progress on the success community group for Lightning App Builder.

Lightning components are not callable by URL, in fact. They are invoked events registered in the Lightning Component Framework.

This is, in fact, how you invoke standard lightning components.

Let’s say I wanted to make the toast notification pop-down in my custom Lightning UI, I would do something like this:

            var showToast = $A.get('e.force:showToast');
            showToast.setParams(
                {
                    'title': 'Save Attachment'
                    'message': ': SUCCESS'
                }
            );
            showToast.fire();

When this kicks off, ostensibly when something else was successful, the event here fires, gets the lightning component for the toast feature, and makes it appear and animate, etc.

I suspect that when Lightning reaches more maturity there will be some analog to the custom-button-or-link-to-Visualforce feature we all know and love today, but it will have to follow the constructs of lightning components which use events, it suspect strongly it will not follow the Visualforce construct of request-a-URL.

Attribution
Source : Link , Question Author : Nitish , Answer Author : pchittum

Leave a Comment