public class DeviceCount {
private Id accountId;
private String typeName;
private Integer count;
public DeviceCount (Id accountId, String typeName, Integer count) {
this.accountId = accountId;
this.typeName = typeName;
this.count = count;
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 SomeServiceQueueable implements Queueable, Database.AllowsCallouts { | |
private List<Case> cases; | |
public SomeServiceQueueable (List<Case> newCases) { | |
this.cases = newCases; | |
} | |
public void execute (QueueableContext ctx) { | |
if (!this.cases.isEmpty()) { | |
Case toSend = this.cases.remove(0); |
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
{ | |
"012000000000000AAA":{ | |
"available":true, | |
"defaultRecordTypeMapping":false, | |
"master":true, | |
"name":"Master", | |
"recordTypeId":"012000000000000AAA" | |
}, | |
"0121k000000kYckAAE":{ | |
"available":true, |
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 without sharing AccountHandler { | |
public static void postToChatter() { | |
FeedItem fi = new FeedItem(/*Add required fields*/); | |
insert fi; | |
} | |
@future | |
public static void asyncPostToChatter() { | |
postToChatter(); | |
} |
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
// Create a guid for each record. | |
String guid1 = generateGuid(); | |
String guid2 = generateGuid(); | |
String guid3 = generateGuid(); | |
// Assign a guid as external id to each record | |
Map<String, MyObject__c> objects = new Map<String, MyObject__c>(); | |
objects.put(guid1, new MyObject(GUID__c = guid1)); | |
objects.put(guid2, new MyObject(GUID__c = guid2)); | |
objects.put(guid3, new MyObject(GUID__c = guid3)); |
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 virtual class LoggableException extends Exception { | |
private ErrorLog__c errorLog; | |
private List<ExceptionLog__c> exceptionLogs; | |
private List<RowLog__c> rowLogs; | |
private List<ServiceLog__c> serviceLogs; | |
public void init(Exception exc) { | |
errorLog = new ErrorLog__c(); | |
exceptionLogs = new List<ExceptionLog__c>(); | |
rowLogs = new List<RowLog__c>(); |
I'm starting a new Trailhead and I want to track it in version control.
A single keyup event handled twice in the parent component.
once with the new value at event.detail
then again with an integer 0
keyup Lorem ipsum dolor set Lorem ipsum dolor setd
wipContainer.js:4 keyup Lorem ipsum dolor set 0
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 out the currently registered orgs | |
sfdx force:org:list | |
# change directory to user_root/.sfdx | |
cd ~/.sfdx | |
# (windows) open directory in explorer | |
explorer . | |
# credentials are stored in .json files named for each username. |
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
#!/bin/bash | |
OIFS="$IFS" | |
IFS=$'\n' | |
# Salesforce deletes aura component files that were not included in the deployment. So, you have to ensure that you deploy all the files even if only 1 file in a component is changed. Eg: Even if you change just the .cmp file, you still have to deploy the controller, helper, css files, etc. | |
# Replace f7815723e99 with your commit id | |
for var in `git diff --diff-filter=ACMRT --name-only 8ef4dc2d9cf2 HEAD`;do if [[ "$var" = *"/aura/"* ]] || [[ "$var" = *"/lwc/"* ]];then tar -rf local/myfiles.tar `dirname "$var"`;else tar -rf local/myfiles.tar "$var";if [ -f "$var-meta.xml" ];then tar -rf local/myfiles.tar "$var-meta.xml";fi;fi;done | |
cd local | |
tar -xf myfiles.tar | |
#Uncomment these lines if you wish to package the source and deploy to an org | |
#cd local |