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
Contact c = new Contact(); | |
c.lastName = 'Andy The Customer'; | |
c.Email = 'andy@theCustomerEmailAddress.com'; | |
insert c; | |
Case theCase = new Case(); | |
insert theCase; | |
EmailMessage theEmailMessage = new EmailMessage(); | |
theEmailMessage.BccAddress = 'compliance@mostexcellentsoftware.com'; |
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 standardController=”Case” extensions=”DragAndDropController” > | |
<apex:slds > | |
<apex:form > | |
<apex:actionFunction name=”redirectToDragAndDropEmailAuthor” action=”{!goToEmailDragAndDrop}” /> | |
</apex:form> | |
</apex:slds> | |
<script> | |
document.addEventListener(‘readystatechange’, event => { | |
if (event.target.readyState === “interactive”) { |
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 DragAndDropController | |
{ | |
public String bccAddresses {get; set;} | |
public String ccAddresses {get; set;} | |
public String toAddresses {get; set;} | |
public String caseId {get; set;} | |
public String caseIdChosen {get; set;} | |
public String contactIdToEmail {get; set;} | |
public String externalComments {get; set;} | |
public String htmlBody {get; set;} |
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 sendAccountNames(cellData) { | |
Visualforce.remoting.Manager.invokeAction( | |
CSVParser.insertAccounts(cellData, | |
function(result, event) { | |
console.log('@@@ result is: ' + result); | |
console.log('@@@ event is: ' + event); | |
})); | |
} | |
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
global class CSVParser | |
{ | |
@RemoteAction | |
global static void insertAccounts(List<String> accountNames) | |
{ | |
system.debug('The Account Names from the .csv are: ' + accountNames); | |
List<Account> accounts = new List<Account>(); | |
Account account; |
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 controller="CSVParser" docType="html-5.0" lightningStylesheets="false" showHeader="false" sidebar="false" standardStylesheets="false"> | |
<head lang="en"> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> | |
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js" /> | |
<apex:includeScript value="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.1.0/papaparse.js"/> | |
<!--<apex:includeScript value="{!$Resource.papaparse2}"/>--> | |
<link rel="stylesheet" href="https:maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/> | |
<link rel="stylesheet" href="https:maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"/> | |
<div class="main"> |
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
({ | |
doInit : function(component, event, helper) { | |
console.log('the doInit was called'); | |
var fullURL = window.location.href; | |
var recordTypeId = fullURL.substring(fullURL.indexOf("recordTypeId") + 13,fullURL.indexOf("recordTypeId") + 31); | |
console.log('the recordTypeId is: ' + recordTypeId); | |
if (recordTypeId != null) { |
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
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride,force:lightningquickActionWithoutHeader"> | |
<aura:attribute name="RecordTypeId" type="String" access="public"/> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> | |
<lightning:recordEditForm aura:id="recordEditForm" recordId="{!v.RecordId}" recordTypeId="{!v.RecordTypeId}" objectApiName="Account" class="slds-p-top_small"> | |
<span class="slds-hide slds-required" aura:id="required">*</span> | |
<lightning:inputField aura:id="picklist" fieldName="Industry" /> | |
<lightning:inputField fieldName="RecordId" value="{!v.RecordId}" class="slds-hide" /> | |
<lightning:inputField fieldName="RecordTypeId" value="{!v.RecordTypeId}" class="slds-hide" /> | |
</lightning:recordEditForm> | |
<!--<lightning:recordEditForm aura:id="recordEditForm" recordId="{!v.RecordId}" recordTypeId="{!v.RecordTypeId}" objectApiName="Account" class="slds-p-top_small"> |
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
// Too many DML's issue: | |
List<Account> accountList = new List<Account>(); | |
Account accountObject; | |
for (Integer i = 0; i < 150; i++) | |
{ | |
accountObject = new Account(); | |
accountObject.Name = 'Test ' + i; | |
accountList.add(accountObject); | |
} | |
insert accountList; |
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
// SOQL in a for loop issue: | |
List<Account> accounts = [SELECT Id, Name FROM Account]; | |
List<Integer> contactCount = new List<Integer>(); | |
for (Integer i = 0; i <= accounts.size(); i++) | |
{ | |
Integer count = [SELECT COUNT() FROM Contact WHERE AccountId IN : accounts ]; | |
contactCount.add(count); | |
} | |
// SOQL in a for loop fix: |
NewerOlder