Skip to content

Instantly share code, notes, and snippets.

View amitastreait's full-sized avatar
🎯
Creativity ki potli liye chala ja raha ek bairagi

Amit Singh amitastreait

🎯
Creativity ki potli liye chala ja raha ek bairagi
View GitHub Profile
@amitastreait
amitastreait / SOQL Use case for practice
Created May 5, 2023 05:50
SOQL Use case for practice in salesforce.
1. What is SOQL in Salesforce?
2. What is the Structure of the SOQL Query in Salesforce?
3. List All the Contact Records
4. List All the Contact Records where the Email is not blank
5. List All the Contact Records Where the Email is Blank
6. List All the Contact Records Where the Title contains the developer
7. List All the Contact Records Where the Title Starts with the Manager
8. List All the Opportunity Where the Amount is more than 29000
9. List All the Opportunity count state wise
10. List All the Opportunity Amount Stage Wise
@amitastreait
amitastreait / Approval.html
Last active October 12, 2023 10:13
Approve Reject records from the Apex Class using Lightning Flow or Apex Class
<template>
<lightning-card variant="Narrow">
<lightning-spinner alternative-text="Loading" size="small" variant="brand" if:true={isloading} ></lightning-spinner>
<div class="slds-p-around_small">
<lightning-button-group>
<lightning-button label="Approve" title="Approve" onclick={handleApprove}></lightning-button>
<lightning-button label="Reject" title="Reject" onclick={handleReject}></lightning-button>
<lightning-button if:true={showRecall} label="Recall" title="Recall" onclick={handleRevoke}></lightning-button>
</lightning-button-group>
</div>
import { LightningElement, track, wire } from 'lwc';
import listAllMessages from '@salesforce/apex/WhatsAppLWCService.listAllMessages';
import sendTextMessage from '@salesforce/apex/WhatsAppLWCService.sendTextMessage'
import getSingleMessage from '@salesforce/apex/WhatsAppLWCService.getSingleMessage';
import { subscribe, unsubscribe, onError } from 'lightning/empApi';
export default class Chatcomponent extends LightningElement {
@track messages;
@amitastreait
amitastreait / PKCEOAuthHelper.java
Created April 20, 2023 17:57
PCKE Flow Salesforce generate code verifier and code challenge
public class PKCEOAuthHelper {
public static void printDetails(){
String code_verifier = SFDC_GENERATE_RANDOM_STRING(56);
Blob sha256 = Crypto.generateDigest('SHA-256', Blob.valueOf(code_verifier));
String code_challenge = SFDC_BASE64_URLENCODE(sha256);
System.debug('**** code_verifier **** \n '+code_verifier);
System.debug('**** code_challenge **** \n '+code_challenge);
import { LightningElement } from 'lwc';
export default class UserInformation extends LightningElement {
/* The Example JSON file */
person = {
"First Name": "Rack's",
"Last Name": "Jackon",
"Gender": "man",
"Age": 24,
"Street Address": "126",
public class TwilioService {
@InvocableMethod(label='Send Verification SMS' description='Send Verification SMS' category='Login' callout=true)
public static List<TwilioService.InputWrapper> run(List<TwilioService.InputWrapper> code){
sendSMS(code.get(0));
return code;
}
private static void sendSMS(TwilioService.InputWrapper input){
{
"records": [
{
"attributes": {
"type": "Account",
"referenceId": "AccountRef1"
},
"AccountId": 9000,
"Name": "Alpha Dynamics",
"Type": "Technology Partner",
{
"records": [
{
"attributes": {
"type": "Contact",
"referenceId": "ContactRef1"
},
"Id": 1,
"AccountId": "@AccountRef1",
"FirstName": "Amy",
@amitastreait
amitastreait / PathComponent.html
Last active January 5, 2024 09:49
Create custom path component using lightning web component
<template>
<lightning-card variant="Narrow" >
<lightning-spinner alternative-text="Loading" size="small" if:true={isLoading}></lightning-spinner>
<!--Display the button on the top-->
<p slot="actions" if:true={isTop}>
<lightning-button if:true={showButton} variant="brand" label={buttonLabel} title={buttonLabel} onclick={handleClick}></lightning-button>
</p>
<div class="slds-m-around_small" if:true={isTop}>
<lightning-progress-indicator current-step={currentValue} type={pathType} has-error="false" variant="shaded">
<template if:true={pathValues} for:each={pathValues} for:item="step" for:index="index">
@isTest
public class LogoutEventTriggerTest {
@isTest
public static void logOutTest() {
LogoutEventStream stream = new LogoutEventStream(
);
EventBus.publish(stream);
}