Skip to content

Instantly share code, notes, and snippets.

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;
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;
<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%;
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);
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);
.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;
}
function searchReport(searchInputId, searchTableId)
{
var input, filter, table, tr, td, i;
input = document.getElementById(searchInputId);
filter = input.value.toUpperCase();
table = document.getElementById(searchTableId);
tr = table.getElementsByTagName("tr");
// Loop through all table rows, and hide those who don't match the search query
for (i = 0; i < tr.length; i++) {
<iframe>
<html>
<head>
<script src='https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit' /> </script>
<script type="text/javascript">
var callPostMethod = function (action, response) {
var hostURL = window.location.origin;
parent.postMessage({ action: action, response : response }, hostURL);
}
var onVerifyCallback = function () {
@sudikrt
sudikrt / CaseController.apxc
Created August 10, 2019 06:09
This vf page helps to upload the attachment to the web to case. So that you can embed this VF page inside your lightning component.
public class CaseController {
public transient Attachment objAttachment;
public String message{get;set;}
public String messageType{get;set;}
public Boolean fileUploadProcessed{get;set;}
public Attachment getObjAttachment () {
objAttachment = new Attachment ();
return objAttachment;
jQuery(function($){
var lastHeight = 0, curHeight = 0, $frame = $('iframe:eq(0)');
setInterval(function(){
curHeight = $frame.contents().find('body').height();
if ( curHeight != lastHeight ) {
$frame.css('height', (lastHeight = curHeight) + 'px' );
}
},500);
});