Thursday, May 16, 2019

Handling Platform Events in Lightning Components

The lightning:empApi component gives methods for subscribing to a streaming channel and listening to event messages. It supports all streaming channels including channels for platform events, pushTopic events and Change Data Capture events. The lightning:empApi component uses a shared CometD connection.

Note:
  • This component is available in 44.0 api version or later.
  • This is available in Lightning Experience and only supported in desktop browsers.
To call the component's methods, add the lightning:empApi component inside your custom component and assign an aura:id attribute to it.

If you want to learn more about platform events then refer below blog:

Platform Events : Way to Deliver Custom Notifications within Salesforce or to external Applications

I have created a lightning component which will subscribe to platform event "Demo_Event__e" which we have created in our previous blog.

I have created an app page using lightning app builder named as "Platform Events App Page". and added this lightning component into it.

Code Snippet:

Below is snapshot of Lightning App page before platform event is fired.

Now fire platform event using workbench through REST API call

Platform event notification received in lightning component.

Hope this will help to understand platform events handling in lightning components. 

Looking forward for everyone's suggestions and comments!!!


41 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. best texting service

    ReplyDelete
  3. When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your. simply buzzes

    ReplyDelete
  4. I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. pipedrive pricing

    ReplyDelete
  5. Thanks a lot for sharing this excellent info! I am looking forward to seeing more posts by you as soon as possible! I have judged that you do not compromise on quality. material equipements for handling

    ReplyDelete
  6. The article looks magnificent, but it would be beneficial if you can share more about the suchlike subjects in the future. Keep posting. sviluppo siti web Milano

    ReplyDelete
  7. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. 1000 Pip Builder Forex Signals Review

    ReplyDelete
  8. I would make sure the site looked professional of course, I believe that having quality photography and a clean design are the two best ways to get a professional site. I would have a very limited amount of outgoing links on my main page and NO BANNERS from directories. Webdesign

    ReplyDelete
  9. Is there a way to subscribe to platform events for a specific records updates? I am working on Account "Target Corp", and an event was published for Target Corp. Is there a way to display that the message using EMPAPi to users only working on Target Corp?

    ReplyDelete
  10. Webmasters are guaranteed to remain competitive in the online business if they stick with SEO experts. They will have all they need to ensure business success. Webdesign Limburg

    ReplyDelete
  11. Then I start to second guess myself. All of these thoughts pop into my head more than once every day, and it's an ongoing struggle to get past all the doubts and uncertainties. Webdesignprofessioneel.be

    ReplyDelete
  12. TAXPRO is a chief expert administration firm enhancing the matter of its customers for over 30 decades. We do this by giving a wide array of administrations in the monetary space which ranges from Entry Level Strategy, Taxation consultancy administrations, GST, Audit and Assurance, Accounting, Corporate Compliance, Payroll Services, ESI/PF Consultancy, and part more. We are a group of expense experts that incorporates Chartered Accountants, Advocates, Company Secretaries, Financial counselors offering marketing for accounting to the makers, Traders, Dealers, and specialist organizations of the business. Our administrations are looked for different business, lawful, and tax assessment confusions.

    ReplyDelete
  13. TAXPRO is a chief expert administration firm enhancing the matter of its customers for over 30 decades. We do this by giving a wide array of administrations in the monetary space which ranges from Entry Level Strategy, Taxation consultancy administrations, GST, Audit and Assurance, Accounting, Corporate Compliance, Payroll Services, ESI/PF Consultancy, and part more. We are a group of expense experts that incorporates Chartered Accountants, Advocates, Company Secretaries, Financial counselors offering taxpro to the makers, Traders, Dealers, and specialist organizations of the business. Our administrations are looked for different business, lawful, and tax assessment confusions.

    ReplyDelete
  14. However, most companies will not support sites in which the client has made changes to the original code. Make sure to discuss this during your initial consultation. Webdesigner Antwerpen

    ReplyDelete
  15. At the point when the youthful couple withdrew for their special night, my mom, I, Rupert's mom and sibling, all hosted a calm gathering among ourselves, to pay tribute to the achievement of the wedding that had occurred. My mom encouraged me to get hitched and settle down and surprisingly guaranteed me that she would toss as beautiful a gathering for me as she had tossed for Daniela. The entire event was unrealistic, similar to a fantasy that left us, groups of the couple, pretty overpowered.420 events nj

    ReplyDelete
  16. Nice to be visiting your blog once more, it has been months for me. Well this article that ive been waited for therefore long. i want this article to finish my assignment within the faculty, and it has same topic together with your article. Thanks, nice share. top software tools for writers

    ReplyDelete
  17. As the first-generation rechargeable disposable cannabis vape pen by Cilicon, SOLO has gained great attention from cannabis companies and cannabis vapors. Since SOLO faces the cannabis world, we have received many reviews and questions about SOLO. In this introduction, we will introduce SOLO to resolve all your focus. For more information at disposable cannabis vape pen

    ReplyDelete
  18. Cilicon Spark is the best 510 thread vape pen battery for THC and CBD vaping. it is compatible to all 510 thread cartridge, Spark’s reliable quality promise a durable life expectancy. Read more at the best 510 vape battery.

    ReplyDelete
  19. It's really nice and meanful. it's really cool blog. Linking is very useful thing.you have really helped lots of people who visit blog and provide them usefull information 에볼루션카지노

    ReplyDelete
  20. I loved the spot they leased for facilitating the event, a spot close to Sorbonne in the Latin Quarters. Social events

    ReplyDelete
  21. ESD Wrist Strap is a basic and widely facility in ESD equipment usage, which is very convenient for workers to operate and enables them to ground while working on the Sensitive Electronics. It is compose of wrist loop and grounding wire, the wrist loop is contact with skin directly. Here's information about anti-static wristband, read on to know.

    ReplyDelete
  22. i am so pleased i located your blog website, i honestly situated you by mistake, even as i used to be taking a examine on google for any other factor, in any case i am below now similarly to additionally would in reality similar to to insist supply way to for an outstanding blog submit together with an all-around unique net site. I'm honestly taking part in reading your properly written articles. It looks as if you spend plenty of effort and time for your blog. I have bookmarked it and i'm searching ahead to reading new articles. Hold up the good paintings. That is my first time go to in your weblog and i'm very interested in the articles which you serve. Offer sufficient expertise for me. Thank you for sharing beneficial and don’t forget about, maintain sharing beneficial data: 먹튀검증

    ReplyDelete
  23. howdy! This newsletter could not be written much higher! Searching through this text rings a bell in my memory of my preceding roommate! He constantly stored preaching approximately this. I am going to send this newsletter to him. Fairly certain he will have a remarkable study. Thank you for sharing! Hi there, i think your weblog can be having browser compatibility problems. When i check your weblog in safari, it looks nice but when starting in i. E., it has some overlapping troubles. I just desired to offer you a short heads up! Except that, first-rate website online! Spot on with this write-up, i genuinely sense this terrific web site needs a tremendous deal extra attention. I’ll possibly be returning to study through extra, thanks for the records! Aw, this become a clearly top put up. Taking the time and real attempt to create a very good article… but what can i say… i positioned matters off a whole lot and do not manage to get nearly something carried out. 헤이먹튀

    ReplyDelete
  24. an outstanding percentage! I’ve just forwarded this onto a co-worker who have been doing some research in this. And he in truth ordered me dinner because i found it for him… lol. So allow me to reword this…. Thank you for the meal!! However yeah, thanx for spending the time to speak about this problem here in your blog. Your style could be very specific in contrast to other humans i have study stuff from. Thanks for posting if you have the possibility, wager i'm able to simply e book mark this website. Precise post. I study something new and tough on web sites i stumbleupon regular. It’s constantly thrilling to examine content material from other writers and use something from different websites. 먹튀사이트

    ReplyDelete
  25. having study this i idea it become extremely enlightening. I admire you spending a few time and effort to position this brief article collectively. I over again locate myself for my part spending loads of time both reading and posting feedback. However so what, it was nonetheless worth it! Whats up! This weblog put up couldnot be written any higher! Going via this publish jogs my memory of my previous roommate! He usually saved preaching approximately this. I’ll ship this text to him. Quite sure he’ll have a top notch examine. Many thank you for sharing! I ought to thanks for the efforts you’ve put in scripting this website. I genuinely desire to look the same high-grade content material by you within the future as well. In fact, your innovative writing capabilities has encouraged me to get my very own website now �� 먹튀검증

    ReplyDelete
  26. proper day! I could have sworn i’ve visited this site earlier than but after searching at some of the posts i found out it’s new to me. Regardless, i’m clearly glad i came throughout it and that i’ll be bookmarking it and checking back frequently! After looking into a handful of the weblog articles in your net site, i genuinely respect your way of writing a blog. I saved it to my bookmark website list and will be checking returned quickly. Check my internet site too and permit me recognize how you sense. Hey! This blog put up couldn’t be written plenty higher! Searching through this publish reminds me of my previous roommate! He constantly saved preaching approximately this. I'm going to forward this statistics to him. Quite sure he may have a outstanding examine. Thank you for sharing! 토토사이트

    ReplyDelete
  27. i've been browsing on-line extra than 3 hours lately, but i by no means found any thrilling article like yours. It is lovely price sufficient for me. In my opinion, if all internet owners and bloggers made first rate content material fabric as you did, the net can be loads more beneficial than ever earlier than. Sincerely similar to your web page despite the fact that, you want to examine the transliteration on a very good wide variety of of 1's content material. Several of options crammed by the usage of transliteration problems so i to get them quite difficult to tell the reality however i maximum definitely will truthfully return all over again. Whoah this blog is splendid i love analyzing your articles. Preserve up the best work! You already know, plenty of people are looking round for this data, you could aid them greatly. 먹튀검증

    ReplyDelete
  28. hiya, i assume your web page is probably having web browser compatibility problems. When i test your weblog in safari, it seems great but while establishing in net explorer, it has some overlapping troubles. I merely wanted to present you a short heads up! Apart from that, remarkable website! Hi, i do think this is a fantastic web website. I stumbledupon it 😉 i may revisit yet again on the grounds that i have stored as a favourite it. Money and freedom is the finest way to change, may additionally you be rich and keep to manual other people. I’m extra than satisfied to find out this website. I want to to thank you on your time for this specially extremely good read!! I truely preferred each little bit of it and that i have you e book-marked to look at new stuff on your website. 토토커뮤니티

    ReplyDelete
  29. almost all of what you say is astonishingly suitable and that makes me marvel the purpose why i had not checked out this in this mild formerly. This particular piece without a doubt did turn the mild on for me individually as far as this precise subject matter goes. However at the moment there is actually one specific factor i'm now not necessarily too secure with so at the same time as i make the effort to reconcile that with the real principal concept of your difficulty, allow me see what the relaxation of the subscribers need to factor out. Well done. You could virtually see your abilities within the paintings you write. The arena hopes for more passionate writers such as you who aren't afraid to say how they consider. Constantly observe your coronary heart. 토토경비대

    ReplyDelete
  30. i virtually love your website.. Very great colors & subject matter. Did you create this website yourself? Please respond back as iím hoping to create my very personal weblog and would love to examine where you purchased this from or exactly what the topic is known as. Thank you! My partner and i honestly love your weblog and locate plenty of your post’s to be what precisely i’m searching out. Does one offer visitor writers to jot down content for you in my opinion? I wouldn’t thoughts composing a post or elaborating on many of the topics you write associated with right here. Again, outstanding blog! You've got made a few respectable points there. I looked on the internet for extra facts approximately the problem and determined maximum individuals will go along with your views on this internet web site. This blog is actually alternatively available considering that i’m in the meanwhile growing a web floral internet site – even though i'm handiest starting out consequently it’s virtually pretty small, nothing like this web page. Can link to a few of the posts right here as they are pretty. Thanks tons. 아도에이전트

    ReplyDelete
  31. i've been browsing on-line extra than 3 hours lately, but i by no means found any thrilling article like yours. It is lovely price sufficient for me. In my opinion, if all internet owners and bloggers made first rate content material fabric as you did, the net can be loads more beneficial than ever earlier than. Sincerely similar to your web page despite the fact that, you want to examine the transliteration on a very good wide variety of of 1's content material. Several of options crammed by the usage of transliteration problems so i to get them quite difficult to tell the reality however i maximum definitely will truthfully return all over again. Whoah this blog is splendid i love analyzing your articles. Preserve up the best work! You already know, plenty of people are looking round for this data, you could aid them greatly. 먹튀프렌즈

    ReplyDelete
  32. may i absolutely say what a alleviation to discover someone that truly knows what they're speaking approximately on-line. You actually apprehend a way to deliver a problem to light and make it important. Extra people have to check this out and recognize this facet of the story. I was amazed that you aren't greater famous because you virtually have the gift. Subsequent time i study a blog, i'm hoping that it does not disappoint me just as much as this one. I imply, i comprehend it become my preference to examine, despite the fact that i actually believed you will likely have some thing exciting to speak about. All i listen is a gaggle of crying approximately some thing you may restoration if you were now not too busy searching for attention. You've made a few first rate factors there. I checked at the internet to find out extra about the issue and determined most people will go with your views in this website. 카디즈에이전시

    ReplyDelete
  33. greetings! This is my 1st remark here so i just wanted to offer a brief shout out and inform you i truely revel in reading thru your posts. Are you able to recommend another blogs/web sites/forums that go over the same subjects? Thank you to your time! I really like your writing so much! Share we keep up a correspondence more approximately your publish on aol? I require an expert on this residence to get to the bottom of my hassle. Can be that’s you! Having a sit up for appearance you. Thank you for every other astounding article. Where else should everyone get that type of statistics in this sort of ideal manner of writing? I have a presentation next week, and i'm at the search for such information. 모두의토토

    ReplyDelete
  34. hiya there and thanks for your information – i’ve truly picked up whatever new from proper right here. I did but knowledge a few technical points the usage of this web website, considering i experienced to reload the website usually preceding to i should get it to load nicely. I have been wondering in case your net hosting is adequate? Now not that i'm complaining, however sluggish loading instances instances will on occasion have an effect on your placement in google and can harm your high-quality rating if marketing and advertising and marketing with adwords. Besides i’m adding this rss to my email and can look out for lots extra of your respective thrilling content material. Ensure you update this once more quickly.. I just like the valuable info you offer on your articles. I will bookmark your blog and test once more here often. I’m pretty positive i’ll research plenty of new stuff proper right here! Top success for the subsequent! 토토서치

    ReplyDelete
  35. an outstanding percentage! I've just forwarded this onto a coworker who has been engaging in a little research on this. And he in fact ordered me dinner virtually because i stumbled upon it for him… lol. So allow me to reword this…. Thank you for the meal!! However yeah, thanx for spending time to speak approximately this depend right here for your website. Hi there, there’s no question that your website online may want to probably be having web browser compatibility problems. On every occasion i observe your website in safari, it seems satisfactory however, if starting in net explorer, it’s were given a few overlapping issues. I simply desired to offer you a brief heads up! Besides that, brilliant web page! 먹튀검증

    ReplyDelete
  36. super information in your weblog, thanks for taking the time to percentage with us. Tremendous insight you have on this, it’s best to find a internet site that details so much facts approximately extraordinary artists. Very useful facts shared in this article, properly written! I could be reading your articles and the usage of the informative pointers. Looking forward to examine such knowledgeable articles. I’ve been searching for hours in this subject matter and sooner or later located your put up. , i have read your post and i am very impressed. 먹튀대피소

    ReplyDelete
  37. it's far suitable time to make some plans for the longer term and it’s time to be happy. I’ve study this post and if i may additionally i want to endorse you a few attention-grabbing matters or pointers. Possibly you may write subsequent articles referring to this text. Thanks for sharing superb informations. Your internet site is so cool. I'm impressed through the information that you’ve in this web site. It reveals how properly you understand this challenge. Bookmarked this web web page, will come returned for extra articles. You, i discovered just the records i already searched anywhere and simply could not encounter. What a super internet web site. 안전지대

    ReplyDelete
  38. Through a greater part of these stages, you will have the choice to deal with installments by means of numerous courses like Visas, wire moves, or even PayPal. web-based reserved seating software

    ReplyDelete
  39. I loved the spot they leased for facilitating the event, a spot close to Sorbonne in the Latin Quarters.Women Focused Events

    ReplyDelete