Skip to content

Instantly share code, notes, and snippets.

View ReddyMallareddy's full-sized avatar

ReddyMallareddy

View GitHub Profile
<apex:page standardController="Contact" extensions="LookupAutoCompleteKI" lightningStylesheets="true">
<apex:form id="theForm">
<apex:inputText value="{!myvalue}">
<apex:actionSupport event="onclick" action="{!doNothing}" rerender="theForm"></apex:actionSupport>
</apex:inputText>
<apex:pageBlock id="theForm" title="{!IF(accList!= NULL && accList.size > 0,'All Accounts','There are no records to display')}">
<apex:pageblocktable var="acc" value="{!accList}">
public class GenerateSurvey {
@InvocableMethod
public static void CreateSurveyInv(List < Id > CaseId) {
string CaId;
string CaseNumber;
string communityId;
string SurveyId;
List < ServiceAppointment > ServiceA = [select id, EarliestStartTime, DueDate from ServiceAppointment where Id = '08p7F000000dEmEQAU'];
for (ServiceAppointment sa: ServiceA) {
Id schedulingPolicyId = [SELECT Id FROM FSL__Scheduling_Policy__c WHERE Name = 'Customer First'
LIMIT 1
].Id;
FSL.ScheduleResult myResult = new FSL.ScheduleResult();
myResult = FSL.ScheduleService.schedule(schedulingPolicyId, sa.Id);
sa.ArrivalWindowStartTime = slots[0].Interval.Start;
sa.ArrivalWindowEndTime = slots[0].Interval.Finish;
sa.description = 'Passing Via Anonymous Code';
}
update ServiceA;
List < ServiceAppointment > ServiceA = [select id, EarliestStartTime, DueDate from ServiceAppointment where Id = '08p7F000000dEmEQAU'];
Id schedulingPolicyId = [SELECT Id FROM FSL__Scheduling_Policy__c WHERE Name = 'Customer First'
LIMIT 1
].Id;
operatinghours oh = new operatinghours();
TimeZone tz = TimeZone.getTimeZone('GMT'); //Time in GMT time
FSL.AppointmentBookingService.SortResultsBy sortResults = FSL.AppointmentBookingService.SortResultsBy.Grade;
@ReddyMallareddy
ReddyMallareddy / Survey.html
Created May 28, 2020 14:54
survey for community
<apex:page controller="Surveyctlr" action="{!LaunchSurvey}" ></apex:page>
<html>
<script>
function reorder() {
embedded_svc.menu.reorder(["Call"]);
}
</script>
<script src="https://service.force.com/embeddedservice/menu/fab.min.js" type="text/javascript"></script>
<script type="text/javascript">
var initESW = function(gslbBaseURL) {
// Required if you want labels in a language that’s different from your user’s context.
@ReddyMallareddy
ReddyMallareddy / requestpayload.json
Last active May 28, 2020 14:40
Create case and contact on new chat request
{
"organizationId": "00D7F000006PHbw",
"deploymentId": "5727F000000gedQ",
"buttonId": "5737F000000HCFr",
"sessionId": "f30c5b50-d4a7-49ec-a42b-697f2a1e181d",
"userAgent": "Chrome/83.0.4103.61",
"language": "en-US",
"screenResolution": "1900x1080",
"visitorName": "Mallareddy Reddy",
"prechatDetails": [