<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>platformevent &#8211; Hamza Siddiqui</title>
	<atom:link href="https://www.mhamzas.com/blog/tag/platformevent/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.mhamzas.com</link>
	<description>4x Salesforce MVP &#124; 26x Certified &#124; Salesforce App &#38; System Architect</description>
	<lastBuildDate>Tue, 21 Apr 2020 10:04:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
<site xmlns="com-wordpress:feed-additions:1">233526040</site>	<item>
		<title>Platform Events in Lightning Component</title>
		<link>https://www.mhamzas.com/blog/2020/04/21/platform-events-in-lightning-component/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=platform-events-in-lightning-component</link>
					<comments>https://www.mhamzas.com/blog/2020/04/21/platform-events-in-lightning-component/#respond</comments>
		
		<dc:creator><![CDATA[hamza]]></dc:creator>
		<pubDate>Tue, 21 Apr 2020 10:04:03 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[aura]]></category>
		<category><![CDATA[platformevent]]></category>
		<guid isPermaLink="false">https://www.mhamzas.com/?p=3088</guid>

					<description><![CDATA[Platform Events are used to deliver secure, scalable, and customizable notification within Salesforce or external app. Platform Event is based on Event-Driven Architecture. This is built in real time integration patterns&#160;in the Salesforce Platform which&#160;helps&#160;to reduce point-to-point integration. WHEN TO USE PLATFORM <br /><a href="https://www.mhamzas.com/blog/2020/04/21/platform-events-in-lightning-component/" class="more-link btn btn-primary">Read More</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Platform Events are used to deliver secure, scalable, and customizable notification within Salesforce or external app. Platform Event is based on Event-Driven Architecture. This is built in real time integration patterns&nbsp;in the Salesforce Platform which&nbsp;helps&nbsp;to reduce point-to-point integration.</p>



<h4 class="wp-block-heading"><strong>WHEN TO USE PLATFORM EVENTS?</strong></h4>



<ol class="wp-block-list"><li>Platform events are very useful when you want to communicate Salesforce with any external system.</li><li>Platform events are also used to communicate between two lightning applications.</li><li>Platform events are very useful when you want to communicate between two visualforce pages.</li></ol>



<h4 class="wp-block-heading"><strong>SUBSCRIPTION IN PLATFORM EVENT:&nbsp;</strong></h4>



<ol class="wp-block-list"><li>Apex triggers receive event notifications.</li><li>write an&nbsp;“after insert”&nbsp;Apex trigger on the event object to subscribe to incoming events.</li><li>Triggers receive event notifications from various sources—whether they’re published through Apex or APIs.</li><li>Visualforce and Lightning component apps receive events through CometD.</li><li>CometD is a scalable HTTP-based event routing bus that uses an AJAX push technology pattern known as Comet.</li><li>In an external app, you subscribe to events using CometD as well.</li></ol>



<h4 class="wp-block-heading">CREATING PLATFORM EVENT OBJECT</h4>



<p class="wp-block-paragraph">Setup —-&gt; Platform Event —-&gt; New</p>



<p class="wp-block-paragraph">Create Notification__e Platform event</p>



<figure class="wp-block-image"><img data-recalc-dims="1" decoding="async" src="https://innovateforce.files.wordpress.com/2019/04/capture-1.png?w=640" alt="" class="wp-image-175"/><figcaption>Creation of Platform Event Notification__e</figcaption></figure>



<p class="wp-block-paragraph">Create a Lightning Component to display toast based on Platform event Creation</p>



<script src="https://gist.github.com/mhamzas/00d6fa0f47e03d6fd022d8369330d560.js"></script>



<p class="wp-block-paragraph">The&nbsp;<code>lightning:empApi</code>&nbsp;component provides access to methods for subscribing to a streaming channel and listening to event messages. All streaming channels are supported, including channels for platform events, PushTopic events, generic events, and Change Data Capture events. The&nbsp;<code>lightning:empApi</code>&nbsp;component uses a shared CometD connection.</p>



<p class="wp-block-paragraph">To call the component’s methods, add the&nbsp;<code>lightning:empApi</code>&nbsp;component inside your custom component and assign an&nbsp;<code>aura:id</code>&nbsp;attribute to it.</p>



<p class="wp-block-paragraph">Add this lightning component in lightning app utiliy bar</p>



<p class="wp-block-paragraph">Once Platform event record get Created, A toast message is displayed</p>



<figure class="wp-block-image"><img data-recalc-dims="1" decoding="async" src="https://innovateforce.files.wordpress.com/2019/04/capture-2.png?w=640" alt="" class="wp-image-176"/></figure>



<p class="wp-block-paragraph">Source : <a href="https://sfdcrecipes.com/2019/04/13/platform-events-in-lightning-component/">https://sfdcrecipes.com/2019/04/13/platform-events-in-lightning-component/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mhamzas.com/blog/2020/04/21/platform-events-in-lightning-component/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3088</post-id>	</item>
	</channel>
</rss>
