• Saurabh Kulkarni 84
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 9
    Replies
Hello everyone, 

​​​​​I'm trying to use streaming API in lightning component. For which I have added EMP API. This works well for me.

Now, I have custom object which allows user to create some new records and based on which a new channel is created from apex. This record also specifies a list of users who are expected subscribers to this newly created channel. The problem is that the users while being on some page where my lightning component is added cannot get auto subscribed to this newly created channel. Users will have to reload the component (using page reload or refresh) so that I can query new channels and make them auto subscribed on load. I want to remove this dependancy so that users can somehow get auto subscribed to a newly created channel without reload. Is there any way we can do this? 

Thank you in advance 
Saurabh Kulkarni 
I'm using streaming API generic event which can be fired from Streaming REST API. A Lightning aura component is acting as listener with EMP API to subscribe and receive the event. Now, my component is meant to show a toast for any generic message. The user can be on home tab or opportunity or lead or  anywhere. I want him to be subscribed to the channel so that the user can see toast being fired by the streaming api.

I had added my component to home tab and when user loads home tab for first time, he/she is subscribed to it. But when someone while being on some other tab reloads the whole page, then subscription is gone and user can't see the toast.

I want to know if there is a way by which I can make an user subscribed to a streaming channel all the time from login time till logout? 

​​​​​Thanks 
Saurabh
I have question related to managed package development. I have a managed package which has a lightning component which can be added on opportunity record page. Now, this managed package is going to be a paid application on appexchange. The question is what if a customer has installed this app and has got 10 licences and then adds this component on opportunity record page. Will the users other than those 10 users see an error where the component is added saying you do not have license to see this? Or it will work for all? How does it work? 

Hello Everyone,

I have a lightning component added on the record detail page. This component has a controller method which gets fired on "refreshView" event and I have my login in that method. It works all good for all changes I do to my record.
 

However, I want my component to execute this controller method even when record is created. The refreshView event does not get fired when someone creates a record. Is there a way to identify this event?

Thanks 
Saurabh

Hello Everyone

I have a lightning component put on a record page. I'm using RefreshEvent in my component to see if RefreshEvent was done on record page and then perform some action.
<aura:handler event="force:refreshView" action="{!c.handleEvent}"/>

I have my component put on Lead object record page as well as Opportunity record page.

My problem is, when I navigate from Lead Record page to Opportunity record page, and I make some changes on Opportunity record, the RefreshEvent is called twice - one for Lead record (as i had navigated from Lead object, probably it kind of cached it) and one for current Opportunity record. If I'm printing v.recordId in console I clearly see two different record Ids being printed and hence my action is getting called twice for two different records.
 
handleEvent: function(component,event,helper){
        console.log('HANDLER '+component.get('v.recordId'));
}

--
Console Log: 
HANDLER 0063h000004n7r5AAA
HANDLER 00Q3h0000052lCCEAY

How can I tackle this scenario?

Thanks,
Saurabh Kulkarni
Hello All,

I have a situation where aura:iteration is running inside tbody of table to generate dynamic rows. Inside this row, I have a lightning:buttonIcon which has the aura id which is nothing but an attribute. When I do onclick of this buttonIcon which calls my controller method. When i try to fetch the aura id value it returns the attribute as it is instead the value.. Here's my example
 
<table>
   <thead>
   ..
   </thead>
   <tbody>
     <aura:iteration items="{!v.myList}" var="obj">
         <tr>
            <td>
                 <lightning:buttonIcon aura:id="{!obj.Sequence}" iconName="utility:add" onclick="{!c.addRow}" size="x-small"/>
            </td>
         </tr>
     </aura:iteration>
   </tbody>
</table>
------
addRow : function (component,event,helper){
      var a = event.getSource().getLocalId();
      console.log('a '+a); //THIS RETURNS --> a {!obj.Sequence} 
}
-----

 
Hello everyone, 

​​​​​I'm trying to use streaming API in lightning component. For which I have added EMP API. This works well for me.

Now, I have custom object which allows user to create some new records and based on which a new channel is created from apex. This record also specifies a list of users who are expected subscribers to this newly created channel. The problem is that the users while being on some page where my lightning component is added cannot get auto subscribed to this newly created channel. Users will have to reload the component (using page reload or refresh) so that I can query new channels and make them auto subscribed on load. I want to remove this dependancy so that users can somehow get auto subscribed to a newly created channel without reload. Is there any way we can do this? 

Thank you in advance 
Saurabh Kulkarni 
I have question related to managed package development. I have a managed package which has a lightning component which can be added on opportunity record page. Now, this managed package is going to be a paid application on appexchange. The question is what if a customer has installed this app and has got 10 licences and then adds this component on opportunity record page. Will the users other than those 10 users see an error where the component is added saying you do not have license to see this? Or it will work for all? How does it work? 

Hello Everyone,

I have a lightning component added on the record detail page. This component has a controller method which gets fired on "refreshView" event and I have my login in that method. It works all good for all changes I do to my record.
 

However, I want my component to execute this controller method even when record is created. The refreshView event does not get fired when someone creates a record. Is there a way to identify this event?

Thanks 
Saurabh

Hello Everyone

I have a lightning component put on a record page. I'm using RefreshEvent in my component to see if RefreshEvent was done on record page and then perform some action.
<aura:handler event="force:refreshView" action="{!c.handleEvent}"/>

I have my component put on Lead object record page as well as Opportunity record page.

My problem is, when I navigate from Lead Record page to Opportunity record page, and I make some changes on Opportunity record, the RefreshEvent is called twice - one for Lead record (as i had navigated from Lead object, probably it kind of cached it) and one for current Opportunity record. If I'm printing v.recordId in console I clearly see two different record Ids being printed and hence my action is getting called twice for two different records.
 
handleEvent: function(component,event,helper){
        console.log('HANDLER '+component.get('v.recordId'));
}

--
Console Log: 
HANDLER 0063h000004n7r5AAA
HANDLER 00Q3h0000052lCCEAY

How can I tackle this scenario?

Thanks,
Saurabh Kulkarni
Hello All,

I have a situation where aura:iteration is running inside tbody of table to generate dynamic rows. Inside this row, I have a lightning:buttonIcon which has the aura id which is nothing but an attribute. When I do onclick of this buttonIcon which calls my controller method. When i try to fetch the aura id value it returns the attribute as it is instead the value.. Here's my example
 
<table>
   <thead>
   ..
   </thead>
   <tbody>
     <aura:iteration items="{!v.myList}" var="obj">
         <tr>
            <td>
                 <lightning:buttonIcon aura:id="{!obj.Sequence}" iconName="utility:add" onclick="{!c.addRow}" size="x-small"/>
            </td>
         </tr>
     </aura:iteration>
   </tbody>
</table>
------
addRow : function (component,event,helper){
      var a = event.getSource().getLocalId();
      console.log('a '+a); //THIS RETURNS --> a {!obj.Sequence} 
}
-----