Skip to content

Instantly share code, notes, and snippets.

@tjsummerford
tjsummerford / AssignmentGroup_LeadRoundRobin.cls
Last active September 3, 2018 21:47
Adapting Round Robin Record Assignment from Salesforce Labs to assign leads.
public class AssignmentGroup_LeadRoundRobin {
public static void AssignLead(boolean IsUpdate, List<Lead> Leads, Map<Id, Lead> oldMap_Leads){
//
//Check if assignment owner has changed
//
Map<Integer,Id> queueIds = new Map<Integer,Id>(); //Trigger index --> Queue ID
Integer idx = 0;
for (lead l : Leads)
.cProfileCon>div{
display:none !important;
}
.topicLabel {
font-size:200% !important;
font-weight:normal !important;
}
.test {
@tjsummerford
tjsummerford / Useful SOQL Queries
Last active December 6, 2019 16:06
Useful SOQL Queries
//Get Cases followed by User
SELECT Id, CaseNumber, Subject, Owner.Name, Status, CreatedDate, ClosedDate
FROM Case
WHERE Id IN (SELECT ParentId FROM EntitySubscription WHERE SubscriberId = '')
ORDER BY CreatedDate
//Get User Signatures by Profile
SELECT id, FirstName, LastName, email, FederationIdentifier, LastLoginDate, Profile.Name, UserRole.Name, Signature
FROM user
where IsActive = true