Skip to content

Instantly share code, notes, and snippets.

Avatar
👩‍💻

Shruti Sridharan shrutis22

👩‍💻
View GitHub Profile
@shrutis22
shrutis22 / FieldSetCSS.css
Created Oct 16, 2016
CSS File for the Field Set UI Generator
View FieldSetCSS.css
input[type=checkbox] {
position: relative;
width: 1.5rem;
height: 1.5rem;
top: 0.25rem;
}
textarea {
resize: vertical;
}
@shrutis22
shrutis22 / Logout.page
Created Nov 20, 2016
Page created to run the Logout flow when Logout button in Salesforce is clicked
View Logout.page
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
<flow:interview name="Time_Tracker_Logout" finishLocation="{!URLFOR('/secur/logout.jsp')}"></flow:interview>
</apex:page>
@shrutis22
shrutis22 / Logout.js
Created Nov 20, 2016
Script to add custom Logout link in Salesforce. This has to be installed in TamperMonkey
View Logout.js
// ==UserScript==
// @name Custom Logout Flow for Salesforce
// @version 1.0
// @description Custom Logout Flow for Salesforce
// @author Shruti Sridharan
// @match https://*.salesforce.com/*
// @require https://code.jquery.com/jquery-latest.js
// ==/UserScript==
(function() {
@shrutis22
shrutis22 / JDFServices.cls
Created Apr 6, 2017
Build an Employee Check-in System using Tessel and Salesforce
View JDFServices.cls
@RestResource( urlMapping='/employee/*' )
global class JDFServices {
global class Response {
public Boolean status;
public String message;
public Integer statusCode;
public Response( Boolean status, String message, Integer statusCode ){
this.status = status;
this.message = message;
@shrutis22
shrutis22 / index.js
Created Apr 6, 2017
Build an Employee Check-in System using Tessel and Salesforce
View index.js
var tessel = require( "tessel" )
, request = require( "request" )
, Keypad = require( "tessel-async-matrix-keypad" )
, keypadPins = tessel.port.A.pin;
var keypad = new Keypad({
keys: [
["1", "2", "3", "A"],
["4", "5", "6", "B"],
["7", "8", "9", "C"],
@shrutis22
shrutis22 / FieldSetUI.html
Created Oct 16, 2016
Visualforce page for the Field Set UI Generator
View FieldSetUI.html
<apex:page controller="FieldSetUIGenerator" showHeader="false" sidebar="false" standardStylesheets="true" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Field Set UI</title>
<!--This needs to be on the top for a reason-->
@shrutis22
shrutis22 / ComponentDemo.html
Created May 17, 2017
Using Record Lookup Component
View ComponentDemo.html
<apex:page>
<c:RecordLookup id="accLkp" sobject="Account" label="Account" componentWidth="70%" filterListClass="slds-select" recordsListClass="slds-select" load3rdPartyLib="true" onselect="onselect"/>
</apex:page>
@shrutis22
shrutis22 / EinsteinAPI.cls
Created Aug 18, 2017
This class is created to make requests to various Einstein Endpoints.
View EinsteinAPI.cls
/**
* This class is created to make requests to
* various Einstein Endpoints.
*
* @author Shruti Sridharan
* @since 10/08/2017
* @revisions N/A
**/
public class EinsteinAPI {
public String tokenEndpoint {
@shrutis22
shrutis22 / EinsteinServices.cls
Created Aug 18, 2017
This class is created to expose various Einstein Services as web services so that the same can be invoked from JavaScript buttons.
View EinsteinServices.cls
/**
* This class is created to expose
* various Einstein Services as web services
* so that the same can be invoked from
* JavaScript buttons.
*
* @author Shruti Sridharan
* @since 10/08/2017
* @revisions N/A
**/
@shrutis22
shrutis22 / FindSentimentJS.js
Created Aug 18, 2017
Alerts the Sentiment of the text.
View FindSentimentJS.js
{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")}
var resp = sforce.apex.execute(
"EinsteinServices",
"findSentiment",
{
"text" : "{!Task.Description}"
}
);