Skip to content

Instantly share code, notes, and snippets.

View arun12209's full-sized avatar
🥑

Arun Kumar arun12209

🥑
View GitHub Profile
({
FilterRecords: function(component) {
//data showing in table
var data = component.get("v.data");
// all data featched from apex when component loaded
var allData = component.get("v.UnfilteredData");
//Search tems
var searchKey = component.get("v.filter");
// check is data is not undefined and its lenght is greater than 0
if(data!=undefined || data.length>0){
public class ListComponentCntrl {
@AuraEnabled
public static List<Contact> loadData(){
List<Contact> conList = [select Id,Name,Email from Contact order by Name asc];
return conList;
}
}
@arun12209
arun12209 / UploadImages
Created March 17, 2019 07:31
UploadImages
<!-- Name: UploadImages
Decription: Upload images in files object and show them on richtex field on record.
Created Date: 17/03/2019
LastModified Date: 17/03/2019
Created By: Arun Kumar
-->
<apex:page controller="uploadImageCntrl" sidebar="false">
<html>
<head>
<apex:slds />
@arun12209
arun12209 / uploadImageCntrl
Created March 17, 2019 07:34
uploadImageCntrl
/* Name: uploadImageCntrl
Description: Upload files and show image in richtext field on object record page.
Created Date: 17/03/2019
LastModified Date: 17/03/2019
Created By: Arun Kumar
*/
public with sharing class uploadImageCntrl {
public transient Blob imageFile{get;set;}
public string parentRecId ='';
@arun12209
arun12209 / copyToClipboardCmp
Created May 1, 2019 16:48
copyToClipboardCmp
<aura:component controller="copyToClipboardCntrl" implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="recordId" type="string" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="wrapperObj" type="Object"/>
<div class="slds">
<div class="slds-grid">
<div class="slds-col slds-size--12-of-12">
<div class="slds-page-header" style="border-radius: 0px; border-right: 0px;border-left: 0px;border-top: 0px;
box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.1);">
@arun12209
arun12209 / copyToClipboardCmpController
Created May 1, 2019 16:55
copyToClipboardCmpController
({
doInit : function(component, event, helper) {
//get the object details from apex
helper.getsObjectName(component,event,helper);
},
copyLink:function(component,event,helper){
//dynamically creating html component
var hiddenInputEle = document.createElement("input");
//get the title of clicked element (record link)
let val = event.getSource().get("v.title");
@arun12209
arun12209 / copyToClipboardCmpHelper
Created May 1, 2019 16:57
copyToClipboardCmpHelper
({
getsObjectName : function(component, event, helper) {
let action = component.get("c.fetchsObjectDetails");
action.setParams({
"recId" : component.get("v.recordId")
});
action.setCallback(this,function(response){
let state = response.getState();
if(state == 'SUCCESS'){
let result = response.getReturnValue();
@arun12209
arun12209 / copyToClipboardCntrl
Created May 1, 2019 17:02
copyToClipboardCntrl
/* Name:copyToClipboardCntrl
* Description: This Apex class retrieve the sObject details such as Name, record link from database.
* Created Date: 01/05/2019
* LastModified Date:01/05/2019
* Created By: Arun Kumar
* Version: 1.0
*/
public class copyToClipboardCntrl {
@AuraEnabled
@arun12209
arun12209 / copyToClipboardCntrl
Created May 1, 2019 17:02
copyToClipboardCntrl
/* Name:copyToClipboardCntrl
* Description: This Apex class retrieve the sObject details such as Name, record link from database.
* Created Date: 01/05/2019
* LastModified Date:01/05/2019
* Created By: Arun Kumar
* Version: 1.0
*/
public class copyToClipboardCntrl {
@AuraEnabled
@arun12209
arun12209 / MCSubscribeUnsubscribeTrg
Created May 5, 2019 09:06
MCSubscribeUnsubscribeTrg
/* Name:MCSubscribeUnsubscribeTrg
* Description: On contact record insert/update subscribe/unsubscribe member in Mailchimp list.
* Created Date: 05/05/2019
* Last ModifiedDate : 05/05/2019
* Created By: Arun Kumar
*/
trigger MCSubscribeUnsubscribeTrg on Contact (after insert, after update) {
if(trigger.isAfter && trigger.isUpdate){
system.debug('Contact Email has Opted Out: ');