Skip to content

Instantly share code, notes, and snippets.

View victorabraham's full-sized avatar
💭
...

Victor Abraham victorabraham

💭
...
  • United States
View GitHub Profile
#!/bin/bash
echo "Please enter alias of the environment that you want to deploy to"
read aliasInput
rm -rf mdapipackage
sfdx force:source:convert -d ./mdapipackage
sfdx force:mdapi:deploy -w 100 -d ./mdapipackage -u $aliasInput
cmd /k #this keeps the window open after execution so that we can read errors
public with sharing class RecordTypeUtilWithCache {
private static Map<String, Schema.SObjectType> sObjectTypeMap = Schema.getGlobalDescribe();
private static Map<String, Map<String, Schema.RecordTypeInfo>> soTypeToRecordTypesMap = new Map<String, Map<String, Schema.RecordTypeInfo>>();
public static Id getRecordTypeId(String objectName, String recordtypeName) {
Schema.SObjectType sotype = sObjectTypeMap.get(objectName);
Map<String, Schema.RecordTypeInfo> recordTypeMap = soTypeToRecordTypesMap.get(objectName);
if(recordTypeMap == null) {
recordTypeMap = sotype.getDescribe().getRecordTypeInfosByName();
}
public with sharing class RecordTypeUtil {
//Do not use this
public static Id getRecordTypeIdWithoutCache(String objectName, String recordtypeName) {
Map<String, Schema.SObjectType> sObjectTypeMap = Schema.getGlobalDescribe();
Schema.SObjectType sotype = sObjectTypeMap.get(objectName);
Map<String, Schema.RecordTypeInfo> recordTypeMap = sotype.getDescribe().getRecordTypeInfosByName();
return recordTypeMap.get(recordTypeName).getRecordTypeId();
}
}
public class EmailUtility{
//Simple code to send email to a number of email addresses
public static void sendSimpleEmail(List<String> recipientList, String subject, String emailBody){
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setToAddresses(recipientList);
email.setSubject(subject);
email.setPlainTextBody(emailBody);
email.setHtmlBody(emailBody);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
}
<template>
<div class="parent">
<c-lwc-component-a></c-lwc-component-a>
<c-lwc-component-b></c-lwc-component-b>
</div>
</template>
.red-border {
border: 3px solid red;
padding: 50px;
width: 250px;
height: 250px;
float:left;
margin-left: 10px;
}
.green-border {
border: 3px solid green;
padding: 50px;
width: 250px;
height: 250px;
float:left;
}
.child-container {
border: 3px solid red;
margin:50px 10px;
padding: 0 20px;
}
.parent {
border: 3px solid green;
padding: 50px;
}
<template>
<!-- Notice that the uppercase characters in child component name needs to be replaced with - character -->
<c-child-l-w-c-component child-variable="Value sent from Parent"></c-child-l-w-c-component>
<c-child-l-w-c-component child-variable={dynamicVariable}></c-child-l-w-c-component>
</template>