This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add standard object list here if any new standard object supports change data events | |
//At the time of winter19 below object support change data events | |
window.supportedObjectForChangeEvents = ['Account','Asset','Campaign','Case','Contact','ContractLineItem','Entitlement','Lead', | |
'LiveChatTranscript','Opportunity','Order','OrderItem','Product2','Quote','QuoteLineItem','ServiceContract']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This event will be fired whenever new record change has been captured by RecordChangeEventHandler component --> | |
<aura:event type="COMPONENT" description="Event template"> | |
<aura:attribute name="recordData" type="Object" /> | |
</aura:event> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component access="global"> | |
<!-- ChannelName, which needs to subscribed --> | |
<aura:attribute name="channelName" type="String" required="true"/> | |
<!-- Save the reference of current subscription, which can be unsubscribe later on --> | |
<aura:attribute name="subscription" type="Object"/> | |
<!-- This event is fired when a component is destroyed. | |
Handle this event if you need to do custom cleanup when a component is destroyed.--> | |
<aura:handler name="destroy" value="{!this}" action="{!c.unsubscribe}"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
/** | |
* This function calls subscribe method of empApi component | |
* to receive events | |
* @author Manish Choudhari | |
* @version 1.0.0 | |
* */ | |
subscribe: function(component, event, helper) { | |
// Get the empApi component. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable,flexipage:availableForRecordHome,force:hasRecordId,force:hasSObjectName" | |
access="global" | |
controller="RecordChangeCaptureLightningController"> | |
<aura:attribute name="channelName" type="String" default="" /> | |
<aura:attribute name="autoRefresh" type="String" default="Yes" /> | |
<aura:attribute name="isSupported" type="Boolean" default="false" /> | |
<!--Loading list of supported object for change events | |
- This can be configured in a custom setting or custom metadata type also |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
checkCompatibility : function(component, event, helper){ | |
//get current object | |
var objectName = component.get("v.sObjectName"); | |
//Check is object name is not undefined/null | |
if(objectName){ | |
//Get channel name for change event | |
var channelName = helper.getChannelName(objectName); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
/* | |
* This method will call the server side action to get user name | |
* Once user name retrieved, it will show a warning toast to the user | |
* */ | |
getUser : function(component, userId, eventType, entityName) { | |
var action = component.get("c.getUserName"); | |
action.setParams({ | |
"userId" : userId |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Show auto refresh selection in app builder page --> | |
<design:component> | |
<design:attribute name="autoRefresh" label="Auto refresh the page?" datasource="Yes,No" default="Yes" /> | |
</design:component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data":{ | |
"event":{ | |
"createdDate":"2018-10-18T01:17:26.855Z", | |
"replayId":61, | |
"type":"updated" | |
}, | |
"sobject":{ | |
"Type":"Customer - Channel", | |
"Phone":"(785) 241-6201", |