Skip to content

Instantly share code, notes, and snippets.

View shrutis22's full-sized avatar
👩‍💻

Shruti Sridharan shrutis22

👩‍💻
View GitHub Profile
@shrutis22
shrutis22 / ComponentDemo.html
Created May 17, 2017 12:32
Using Record Lookup Component
<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 August 18, 2017 09:42
This class is created to make requests to various Einstein Endpoints.
/**
* 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 August 18, 2017 09:44
This class is created to expose various Einstein Services as web services so that the same can be invoked from JavaScript buttons.
/**
* 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 August 18, 2017 10:03
Alerts the Sentiment of the text.
{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")}
var resp = sforce.apex.execute(
"EinsteinServices",
"findSentiment",
{
"text" : "{!Task.Description}"
}
);
@shrutis22
shrutis22 / SentimentAnalysisResponse.cls
Created August 21, 2017 19:49
This class is created to receive the Response of Sentiment Analysis API.
/**
* This class is created to receive
* the Response of Sentiment Analysis
* API.
*
* @author Shruti Sridharan
* @since 10/08/2017
* @revisions N/A
**/
global class SentimentAnalysisResponse {
@shrutis22
shrutis22 / EinsteinAPIv2.cls
Created September 2, 2017 06:24
This class is created to make requests to various Einstein Endpoints.
/**
* This class is created to make requests to
* various Einstein Endpoints.
*
* @author Shruti Sridharan
* @since 10/08/2017
* @revisions N/A
**/
public class EinsteinAPI {
////////////////////////
@shrutis22
shrutis22 / FindIntentController.cls
Created September 2, 2017 06:34
This class is created to make a playground to try out Intent APIs and predict a block of text.
/**
* This class is created to make a
* playground to try out Intent APIs
* and predict a block of text.
*
* @author Shruti Sridharan
* @since 30/08/2017
* @revisions N/A
**/
public class FindIntentController {
<apex:page controller="FindIntentController" standardStylesheets="false" sidebar="false">
<!--Stylesheets-->
<apex:slds />
<apex:stylesheet value="{!$Resource.FindIntentCSS}" />
<!--Modal-->
<div id="mdlStatus" style="display:none">
<section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open">
<div class="slds-modal__container">
<header class="slds-modal__header">
@shrutis22
shrutis22 / CaseTrigger.cls
Created September 5, 2017 19:32
This trigger is created to run whenever a new case is created.
/**
* This trigger is created to run whenever
* a new case is created.
*
* @author Shruti Sridharan
* @since 05.09.2017
* @revisions N/A
**/
trigger CaseTrigger on Case ( after Insert ) {
IntelligentCaseRouter.assignOwners( Trigger.newMap.keyset() );
@shrutis22
shrutis22 / IntelligentCaseRouter.cls
Created September 5, 2017 19:36
This class is created to assign the cases according to the context of the case issue. The context is found out with the help of Intent APIs.
/**
* This class is created to assign the
* cases according to the context of
* the case issue. The context is
* found out with the help of Intent
* APIs.
*
* @author Shruti Sridharan
* @since 05.09.2017
* @revisions N/A