Skip to content

Instantly share code, notes, and snippets.

View LokeshSagi's full-sized avatar

Lokesh Sagi LokeshSagi

  • MTX Group Inc
  • Hyderabad
View GitHub Profile
@LokeshSagi
LokeshSagi / spinnerComponent.css
Last active June 13, 2023 19:47
Show spinner component in LWC.
.backdrop {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(8, 7, 7, 0.5); /* background color while spinner onscreen */
z-index: 15000; /* set z-index always high */
}
<template>
<div style={buttonStyle}>
<button class={currentClass} style={currentStyle}
onclick={handleButtonClick}>&nbsp;&nbsp;&nbsp;{buttonLabel}&nbsp;&nbsp;&nbsp;</button></div>
</template>
.fill {
display: flex;
justify-content: center;
/* align-items: center; */
overflow: hidden;
position: relative;
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2), inset 0 1px 3px 0 rgba(0,0,0,0.2);
/* cursor: pointer; */
}
.fill img {
public class GooglePlacesAPI {
//Method to make a Callout to Google Place API to get search predications based on input search string
@AuraEnabled(cacheable=true)
public static String getAddressSet(String searchText, Boolean isPersonal){
String result = null;
system.debug('searchText is ' + searchText);
try{
if(searchText != null) {
String apiURL;
// String endpoint = 'callout:Google_Places_API'+EncodingUtil.urlEncode(searchText, 'UTF-8') + '&key=' + getAPIKey();
<template>
<template if:true={label}>
<li data-index={index} style={hideSelectedPicklist} role="presentation"
onclick={handleSelectPicklist} class="slds-listbox__item" aria-disabled="true">
<div class="slds-media slds-listbox__option slds-listbox__option_entity slds-listbox__option_has-meta"
role="option">
<span class="slds-media__body">
<span class="slds-listbox__option-text slds-listbox__option-text_entity">{label}</span>
</span>
</div>
public void saveDocuments() {
fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork(new List<SObjectType> { SBQQ__Quote__c.SObjectType });
// pass your Domain class name to getTriggerEvent method of fflib_SObjectDomain.
// Call disableAll() to disable all trigger contexts.
// Call individual contexts if need to disable in that way -- disableBeforeInsert(), disableBeforeUpdate(), disableAfterUpdate() etc
fflib_SObjectDomain.getTriggerEvent(Quotes.class).disableAll();
// Do DML only if the trigger context is disabled.
public without sharing class AccountSelector extends fflib_SObjectSelector {
// super(false, false, false) - Constructor
// 1st param -> includeFieldSetFields (Set to true if the Selector queries are to include Fieldset fields as well)
// 2nd param -> enforceCRUD (To enforce object level permissions)
// 3rd param -> enforceFLS (To enforece Field Level Security)
public AccountSelector() {
super(false, false, false);
}
// Define all the fields required
public class ServiceClass {
public void sampleMethod(String accountIdParent) {
// Define the Unit of Work instance.
// Mention the objects in independent to dependent order.
fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork(new List<SObjectType> { Account.SObjectType,
Contact.SObjectType,
AccountContactRelation.SObjectType});
// Selector class
AccountContactRelationSelector acsSelector = new AccountContactRelationSelector();
<template>
<div class="slds-grid slds-wrap">
<div class="slds-col slds-size_1-of-1 slds-medium-size_12-of-12 slds-large-size_12-of-12 slds-align_absolute-center">
<button class="slds-button slds-button_brand" onclick={handleCurrentLocation}>Get my current
location</button>
</div>
</div>
</template>
public class GoogleAPI {
//Generic method to get GoogleAPIKey from Custom Label.
public static String getAPIKey() {
String api = Label.GoogleAPIKey;
return api;
}
//Generic Http Callout Method