This file contains 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 EmailReportExport implements Reports.NotificationAction { | |
public void execute(Reports.NotificationActionContext context) { | |
this.createCSVFileAndSendEmail(context.getReportInstance().getReportResults()); | |
} | |
private void createCSVFileAndSendEmail(Reports.ReportResults results){ | |
//Get header column labels | |
MAP<String,Reports.DetailColumn> headerColumnMap = results.getReportExtendedMetadata().getDetailColumnInfo(); |
This file contains 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
/** | |
* Created by kmachhewar on 5/26/18. | |
*/ | |
({ | |
closeMessage : function(component,event){ | |
component.set('v.showMessage',false); | |
} | |
}) |
This file contains 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
/** | |
* Created by kmachhewar on 5/26/18. | |
*/ | |
({ | |
handleShowToastEvent : function(component,event,helper){ | |
event.stopPropagation(); | |
if(event.getParam('message')){ | |
var messages = component.get('v.messages'); | |
let messageItem = { | |
type : event.getParam('type'), |
This file contains 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
<!-- | |
- Created by kmachhewar on 5/26/18. | |
--> | |
<aura:component description="CustomToast"> | |
<aura:attribute name="title" type="String" default="" /> | |
<aura:attribute name="type" type="String" default="" /> | |
<aura:attribute name="message" type="String" default="" /> | |
<aura:attribute name="showMessage" type="Boolean" default="false" /> | |
<aura:attribute name="messages" type="Object[]" default="[]"/> |
This file contains 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
/** | |
* @ApexClass : <APEX_CLASS_NAME> | |
* @Description : This a schedulable batch. | |
*/ | |
global class <APEX_CLASS_NAME> implements schedulable, Database.Batchable<sObject>, Database.AllowsCallouts { | |
global String query = ''; | |
global <APEX_CLASS_NAME>(){ | |
query = '<QUERY_GOES_HERE>'; | |
} |
This file contains 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 Permission Sets to Users | |
List<User> users = [SELECT Id FROM User WHERE username in ('<USERNAME_GOES_HERE>')]; | |
List<PermissionSet> permissionSets = [SELECT Id FROM PermissionSet WHERE Name = '<PERMISSION SET API NAMES GOES HERE>']; | |
List<PermissionSetAssignment> permissionSetAssignemts = new List<PermissionSetAssignment>(); | |
for(User theUser : users){ | |
for(PermissionSet ps : permissionSets){ | |
permissionSetAssignemts.add( | |
new PermissionSetAssignment(AssigneeId = theUser.Id,PermissionSetId = ps.Id ) | |
); | |
} |
This file contains 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
/** | |
* @ApexClass : SFCompareController | |
* @Description : This provides services to SFCompare page, which can be accessed by js remoting. It provides below services. | |
* 1. Logging into SF orgs for obtaining session and instance url. | |
* 2. Fetches code from the SF org. | |
* */ | |
public class SFCompareController { | |
/** | |
* @description : This method does the login to sf orgs and provides session id and |
This file contains 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
function cacheQuery(){ | |
//check if the result came or not | |
if(!document.getElementById('query_results') && document.getElementsByClassName('displayWarning').length == 0 ){//no results found | |
//check if system is not waiting for the result i.e query is processing | |
if(!document.getElementsByClassName('disableWhileAsyncLoading')[0].disabled){ //button is not disabled so try again | |
document.getElementsByClassName('disableWhileAsyncLoading')[0].click(); | |
} | |
} | |
} |
This file contains 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
<apex:page > | |
<apex:includeLightning /> | |
<div id="lightning" /> | |
<button type="button" onclick="callLightningEvent();">Call Lightning Code From VF</button> | |
<script> | |
window.onload = function() { | |
$Lightning.use("c:LightningOutExampleApp", function() { | |
var comapp=$Lightning.createComponent("c:LightningOutExample", | |
{}, | |
"lightning", |
This file contains 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
****** BEGIN --> APEX CLASS wise distribution ***** | |
SELECT ApexClass.Name, COUNT(ID) FROM AsyncApexJob WHERE Status = 'Queued' GROUP BY ApexClass.Name ORDER BY COUNT(ID) DESC | |
****** END --> APEX CLASS wise distribution ***** | |
****** BEGIN --> Kill Async Jobs ***** | |
for ( AsyncApexJob aJob : [ Select id ,Status, ApexClass.Name | |
from AsyncApexJob where Status='Queued' AND ApexClass.Name ='<ApexClassName>' LIMIT 150] ){ |
NewerOlder