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
public class AccountController { | |
@AuraEnabled | |
public static List<Account> getAccountsWithOffset(String pageSize, String pageNumber){ | |
Integer ps = Integer.valueOf(pageSize); | |
Integer pn = Integer.valueOf(pageNumber)-1; | |
List<Account> accounts = [SELECT | |
Id, Name, Phone, Rating, My_Custom_Field__c, Active__c | |
FROM Account LIMIT :Integer.valueOf(ps) OFFSET :(ps*pn)]; | |
return accounts; |
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
({ | |
getAccounts : function(component, helper) { | |
var action = component.get("c.getAccountsWithOffset"); | |
action.setStorable(); | |
var pageSize = component.get("v.pageSize").toString(); | |
var pageNumber = component.get("v.pageNumber").toString(); | |
action.setParams({ | |
'pageSize' : pageSize, | |
'pageNumber' : pageNumber |
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 finction defined column header | |
* and calls getAccounts helper method for column data | |
* editable:'true' will make the column editable | |
* */ | |
doInit : function(component, event, helper) { | |
component.set('v.columns', [ | |
{label: 'Name', fieldName: 'Name', type: 'text', | |
actions:[ |
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:availableForAllPageTypes" | |
access="global" | |
controller="AccountController"> | |
<aura:attribute name="data" type="Object"/> | |
<aura:attribute name="columns" type="List"/> | |
<aura:attribute name="recordId" type="String"/> | |
<aura:attribute name="pageNumber" type="Integer" default="1"/> | |
<aura:attribute name="pageSize" type="Integer" default="10"/> |
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
public class RecordChangeCaptureLightningController { | |
@AuraEnabled | |
public static String getUserName(Id userId){ | |
User u = [SELECT Name FROM User WHERE Id=:userId]; | |
return u.Name; | |
} | |
} |
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", |
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
({ | |
/* | |
* 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
({ | |
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
<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 |