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
Download this as a ZIP file, move the files so they line up in the proper places, then deploy. | |
force-app/main/default/classes/StockMarketSharesWrapper.cls | |
force-app/main/default/classes/StockMarketSharesWrapper.cls-meta.xml | |
force-app/main/default/lwc/wrapperList/wrapperList.html | |
force-app/main/default/lwc/wrapperList/wrapperList.js | |
force-app/main/default/lwc/wrapperList/wrapperList.js-meta.xml | |
Support for question https://salesforce.stackexchange.com/q/365372/2984 |
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
// Regexp from https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression | |
public class Utils { | |
public static String[] findEmailsInString(String source) { | |
String emailRegex = '(?:[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*|"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])'; | |
Pattern p = Pattern.compile(emailRegex); | |
Matcher m = p.matcher(source); | |
String[] emails = new String[0]; | |
while(m.find()) { | |
emails.add(m.group(0)); | |
} |
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
// Randomly select A-Z, a-z, 0-9 | |
String randomStringAllEnhanced(Integer count) { | |
Integer[] chars = new Integer[0], | |
offsets = new Integer[] { 48, 65, 97 }, | |
mods = new Integer[] { 10, 26, 26 }; | |
while(count > chars.size()) { | |
Integer rnd = Math.abs(Crypto.getRandomInteger()), cat = Math.mod(rnd, 3), seed = Math.mod(rnd, mods[cat]); | |
chars.add(seed+offsets[cat]); | |
} | |
return String.fromCharArray(chars); |
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 AWSTranscribeExample extends AWS { | |
public override void init() { | |
endpoint = new Url('https://transcribe.us-west-2.amazonaws.com/'); | |
resource = '/'; | |
region = 'us-west-2'; | |
service = 'transcribe'; | |
accessKey = 'my-key-here'; | |
method = HttpMethod.XPOST; | |
payload = Blob.valueOf('{"LanguageCode": "en-US","Media": {"MediaFileUri": "S3 audio file link"},"MediaFormat": "mp4","MediaSampleRateHertz": 44100,"TranscriptionJobName": "SampleRestJob7"}'); | |
setHeader('x-amz-target','Transcribe.StartTranscriptionJob'); |
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 q341460 { | |
public String property { | |
get; | |
set; | |
} { | |
property = 'Default Property Value'; | |
} | |
public final String finalProperty { | |
get; |
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 Scheduled implements Schedulable { | |
@TestVisible static Boolean executed = false; | |
public void execute(SchedulableContext c) { | |
executed = true; | |
} | |
} |
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 > | |
<aura:attribute name="value" type="Integer" default="0" /> | |
<aura:attribute name="variant" type="String" /> | |
<aura:attribute name="hasVariant" type="Boolean" access="private" default="{!false}" /> | |
<aura:attribute name="ringClass" type="String" access="private" /> | |
<aura:attribute name="iconName" type="String" access="private" /> | |
<aura:attribute name="altText" type="String" access="private" /> | |
<aura:handler name="init" value="{!this}" action="{!c.updateView}" /> |
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 UpdateChangedFieldsController { | |
SObject oldRecord, currentRecord; | |
public UpdateChangedFieldsController(ApexPages.StandardController controller) { | |
oldRecord = controller.getRecord().clone(); | |
currentRecord = controller.getRecord(); | |
} | |
public PageReference saveChanges() { | |
SObject newClone = currentRecord.getSObjectType().newSObject(currentRecord.Id); | |
Map<String, Object> | |
oldValues = oldRecord.getPopulatedFieldsAsMap(), |