Skip to content

Instantly share code, notes, and snippets.

View arun12209's full-sized avatar
🥑

Arun Kumar arun12209

🥑
View GitHub Profile
@arun12209
arun12209 / MCSubscribeUnsubscribeHelper
Created May 5, 2019 09:49
MCSubscribeUnsubscribeHelper
public class MCSubscribeUnsubscribeHelper {
@future(callout=true) // make callout in future method
//Future mehtod called by trigger to subscribe/unsubscribe the member from mailchimp list.
public static void doSubscribeUnsubscribe(Set<string> conEmail){ //
//Get member ids in MD5 format
map<string,string> emailMemberIdMap=new map<string,string>();
map<string,boolean> emailBolMap = new map<string,boolean>();
for(string str:conEmail){ // iterate over set of email ids.
String emailStr = str.substringBefore('|');
@arun12209
arun12209 / ReallocateTasksCntrl
Created June 5, 2019 07:38
ReallocateTasksCntrl
public class ReallocateTasksCntrl {
// fetch tasks record from database
@AuraEnabled
public static List<taskWrapperCls> fetchTasks(){
List<taskWrapperCls> taskList = new List<taskWrapperCls>();
for(Task t:[select Id,Subject,Status,owner.Name,OwnerId,ActivityDate,description,What.Name,What.Id,Priority from Task where Status!='Completed']){
String firstChr = t.Subject.substring(0,1).toUpperCase();
taskList.add(new taskWrapperCls(false,t,firstChr));
}
@arun12209
arun12209 / ReallocateTasksCmp
Created June 8, 2019 08:09
ReallocateTasksCmp
<aura:component controller="ReallocateTasksCntrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<!--<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>-->
<aura:attribute name="tasks" type="Object"/>
<aura:handler event="aura:waiting" action="{!c.showSpinner}"/>
<aura:handler event="aura:doneWaiting" action="{!c.hideSpinner}"/>
<aura:attribute name="Spinner" type="Boolean"/>
<ltng:require styles="{! $Resource. JQDataTable + '/DataTables-1.10.16/media/css/jquery.dataTables.min.css'}"
scripts="{!join(',',
$Resource.JQueryNew ,
$Resource.JQDataTable + '/DataTables-1.10.16/media/js/jquery.dataTables.min.js')}" afterScriptsLoaded="{!c.doInit}"/>
@arun12209
arun12209 / ReallocateTasksCmpController
Created June 8, 2019 08:10
ReallocateTasksCmpController
({
doInit : function(component, event, helper) {
var action = component.get("c.fetchTasks");
action.setCallback(this,function(response){
var state = response.getState();
if(state == 'SUCCESS'){
var result = response.getReturnValue();
console.log('Result: ' +JSON.stringify(result));
component.set("v.tasks",result);
helper.JqScriptsLoaded(component,event,helper);
@arun12209
arun12209 / ReallocateTasksCmpHelper
Created June 8, 2019 08:11
ReallocateTasksCmpHelper
({
JqScriptsLoaded : function(component,event,helper) {
setTimeout(function(){
var ele = component.find('tableId').getElement();
$(ele).DataTable();
// add lightning class to search filter field with some bottom margin..
$('div.dataTables_filter input').addClass('slds-input');
$('div.dataTables_filter input').css("marginBottom", "10px");
@arun12209
arun12209 / ReallocateTasksCmpCSS
Created June 8, 2019 08:12
ReallocateTasksCmpCSS
.THIS #table_container{
background:white;
}
.THIS .changeMe{
background-color:green;
color:white;
}
.THIS [data-letters]:before {
content:attr(data-letters);
display:inline-block;
@arun12209
arun12209 / SelectedTasksCmp
Created June 8, 2019 08:13
SelectedTasksCmp
<aura:component controller="ReallocateTasksCntrl">
<aura:attribute name="taskList" type="string[]"/>
<aura:attribute name="userList" type="Object"/>
<aura:attribute name="row" type="Integer"/>
<aura:attribute name="selectedUserId" type="string"/>
<!--<aura:handler name="init" value="this" action="{!c.doInit}"/>-->
<ltng:require styles="{! $Resource. JQDataTable + '/DataTables-1.10.16/media/css/jquery.dataTables.min.css'}"
scripts="{!join(',',
$Resource.JQueryNew ,
$Resource.JQDataTable + '/DataTables-1.10.16/media/js/jquery.dataTables.min.js')}" afterScriptsLoaded="{!c.doInit}"/>
@arun12209
arun12209 / SelectedTasksCmpController
Created June 8, 2019 08:14
SelectedTasksCmpController
({
doInit : function(component, event, helper) {
//alert('Insider');
var action = component.get("c.fetchUsers");
action.setCallback(this,function(response){
var state = response.getState();
if(state =='SUCCESS'){
var result = response.getReturnValue();
@arun12209
arun12209 / SelectedTasksCmpHelper
Created June 8, 2019 08:15
SelectedTasksCmpHelper
({
doTaskTransfer : function(component,event,helper,tasks,selectedUser) {
var action = component.get("c.TaskTransfer");
action.setParams({
"tasksRec" : tasks,
"userId" : selectedUser
});
action.setCallback(this,function(response){
var state = response.getState();
@arun12209
arun12209 / SelectedTasksCmpCSS
Created June 8, 2019 08:15
SelectedTasksCmpCSS
.THIS #table_container{
background:white;
}
.THIS [data-letters]:before {
content:attr(data-letters);
display:inline-block;
font-size:1em;
font-weight:bold;
width:2.5em;
height:2.5em;