Skip to content

Instantly share code, notes, and snippets.

.THIS span .slds-radio_faux::after {
background: #5d9732 !important;
}
.THIS .slds-radio [type="radio"]:focus + .slds-radio__label .slds-radio_faux {
border-color: #5d9732 !important;
box-shadow: 0 0 3px #5d9732 !important;
}
global class EmailToLead implements Messaging.InboundEmailHandler {
global Messaging.InboundEmailResult handleInboundEmail (Messaging.InboundEmail email, Messaging.InboundEnvelope envelop ) {
Messaging.InboundEmailResult res = new Messaging.InboundEmailResult ();
Lead leadData = new Lead ();
leadData.LastName = 'Email TO lead';
leadData.Company = 'Email2Lead';
leadData.Email = email.fromAddress;
leadData.TTSApp__StartDate__c = System.now();
leadData.TTSApp__EndDate__c = System.now().addDays(10);
function progress () {
let progressBar = document.getElementById ('progress');
let percentCount = document.getElementById ('percentcount');
let vc_label_units = document.getElementById ('vc_label_units');
let counter = 5;
let progress = 25;
let id = setInterval (frame, 50);
<apex:page standardController="Lead" showHeader="false" sidebar="false" id="page">
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" />
<style>
#spinner{
display: none;
width:300px;
height: 70px;
position: fixed;
top: 50%;
global class DemoFileUploadCntl {
@RemoteAction
global static String createContentVersion(String data, String fileName, String parentId) {
ContentVersion versionData = new ContentVersion ();
versionData.ContentLocation = 's';
versionData.VersionData = EncodingUtil.base64Decode(data);
versionData.PathOnClient = fileName;
versionData.Title = fileName;
insert versionData;
public with sharing virtual class CalloutUtils {
private HttpRequest request;
private Http httpInstance;
private HttpResponse response;
private String method;
private String endPoint;
private String body;
private Integer timeout;
public with sharing class ContentVersionUtil {
public ContentVersionUtil() {
}
public static Id createDocument(Id parentId, String fileName, String data, Id contentDocumentId) {
ContentVersion versionData = new ContentVersion();
versionData.ContentLocation = 'S';
versionData.ContentDocumentId = contentDocumentId;
versionData.VersionData = Blob.valueOf(data);
public with sharing class PermissionExtractorHelper {
private static PermissionExtractorHelper handler;
String email_address = '[email protected]';
private PermissionExtractorHelper() {
}
public static PermissionExtractorHelper getInstance() {
if(handler == null) {
handler = new PermissionExtractorHelper();
}
class A
{
static int i = 1111;
static
{
i = i-- - --i;
System.out.println("ONE");
System.out.println(i);
}
Http Responses
200 “OK” success code, for GET,PATCH or HEAD request.
201 “Created” success code, for POST request.
204 “No Content” success code, for DELETE request.
300 The value returned when an external ID exists in more than one record. The response body contains the list of matching records.
304 The request content has not changed since a specified date and time. The date and time is provided in a “If-Modified-Since” header.
400 The request could not be understood, usually because the ID is not valid for the particular resource. For example, if you use a userId where a groupId is required, the request returns 400.
401 The session ID or OAuth token has expired or is invalid. Or, if the request is made by a guest user, the resource isn’t accessible to guest users. The response body contains the message and errorCode.
403 The request has been refused. Verify that the context user has the appropriate permissions to access the requested data, or that the context user is not an external user.
404 Either the sp