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
List<Account> accList = new List<Account>( | |
[Select | |
Id | |
,Name | |
,(Select | |
From | |
Contacts | |
) | |
From Account] |
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
List<Account> accList = new List<Account>( | |
[Select | |
Id | |
,Name | |
,(Select | |
From | |
Contacts | |
) | |
From Account] |
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
List<Account> accList = new List<Account>([Select Id,Name From Account]); | |
for(Account acc : accList){ | |
Integer numWithEmail = 0; | |
for(Contact cont : [Select Id,Email From Contact Where AccountId = :acc.Id]){ | |
if(!String.isEmpty(cont.Email)){ | |
numWithEmail++; | |
} | |
} | |
} |
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 boolean isTrue(boolean myBool){ | |
return myBool; | |
} | |
public Map<Id,Contact> getContactMap(){ | |
return new Map<Id,Contact>([Select Id From Contact]); | |
} |
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 boolean isTrue(boolean myBool){ | |
if(myBool){ | |
return true; | |
}else{ | |
return false; | |
} | |
} | |
public Map<Id,Contact> getContactMap(){ | |
Map<Id,Contact> contactMap = new Map<Id,Contact>(); |
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
{{#each this.product.prodBean.subscriptionLabels}} | |
{{this}} | |
{{/each}} | |
//Iterate over a seperate array, but with same length. | |
//returns empty string for each subscription label, when it should return some text | |
{{#each this.product.prodBean.subscriptionDurations}} | |
{{this.product.prodBean.subscriptionLabels.[{{@index}}]}}] | |
{{/each}} |
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
toolingSoapSForceCom.SessionHeader_element sessionEl = new toolingSoapSForceCom.SessionHeader_element(); | |
sessionEl.sessionId = UserInfo.getSessionId(); | |
toolingSoapSForceCom.SforceService service = new toolingSoapSForceCom.SforceService(); | |
service.SessionHeader = sessionEl; | |
//service.endpoint_x = //Adjust this to your endpoint, if needed... | |
toolingSoapSForceCom.ApexCodeCoverageAggregateQueryResult queryResult = service.queryApexCodeCoverageAggregate('Select NumLinesCovered From ApexCodeCoverageAggregate'); | |
System.debug(queryResult); |
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 OpportunityTriggerHandler extends TriggerHandler { | |
private Map<Id, Opportunity> newOpportunityMap = new Map<Id, Opportunity>(); | |
private Map<Id, Opportunity> oldOpportunityMap = new Map<Id, Opportunity>(); | |
private List<Opportunity> triggerNew = new List<Opportunity>(); | |
private List<Opportunity> triggerOld = new List<Opportunity>(); | |
public OpportunityTriggerHandler() { | |
this.triggerNew = (List<Opportunity>) Trigger.new; | |
this.triggerOld = (List<Opportunity>) Trigger.old; |
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
global class MySchedulableClass implements Schedulable{ | |
global void execute(SchedulableContext sc){ | |
Database.execute(new MyBatchClass()); | |
} | |
} |
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
protected override void afterInsert() { | |
boolean isSuccessfulRun = false; | |
for(Integer i=0; i < Trigger.new.size() && isSuccessful == false; i++){ | |
isSuccessfulRun |= (((DL__c)Trigger.new.get(i)).Status__c == 'Completed'); | |
} | |
if(isSuccessfulRun){ | |
//Kick off batch jobs | |
Database.executeBatch(new MyNotSoFirstBatchJob(),50); | |
} |