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
<apex:page lightningStylesheets="true" controller="GenericConnectorController">
<apex:includeLightning />
<!-- Define Tab panel .css styles -->
<style>
.activeTab {background-color: #236FBD; color:white; background-image:none}
.inactiveTab { background-color: lightgrey; color:black; background-image:none}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
function checkSelect(selectedtab){
@amitastreait
amitastreait / BookManager
Last active April 11, 2019 11:12
Introduction to Apex Rest with Examples
@RestResource(urlMapping='/v1/BookManagement/')
global class BookManager {
@httpGet
global static Book__c doGetBook(){
Book__c book = new Book__c();
Map<String, String> paramsMap = RestContext.request.params;
String bookId = paramsMap.get('Id');
book = [Select Id, Name, Price__c From Book__c Where Id =: bookId];
return book;
}
public class PerformanceAnalysis {
public static void method1(Id accountId){
List<Contact> contactList = new List<Contact>();
contactList = [Select Id, Name, DoNotCall, AccountId, Account.Name
From Contact Where
AccountId != null
AND accountId =: accountId];
/* For Each */
Long startTime = System.now().getTime();
For(Contact con : contactList){
public class LinkedlnoAuthController{
public Boolean isCode { get; set; }
public String authCodeFromURL { get; set; }
public List<LinkedIn_Information__c> linkedlnInfoList { get; set; }
public String BasicInfo { get; set; }
public String urlToSharedPost { get; set; }
public String sharedInformation { get; set; }
public Final String consumerKey = 'YOUR_CONSUMER_KEY';
import { LightningElement, api } from 'lwc';
export default class MetaExaples extends LightningElement {
@api message;
@api pageno;
}
import { createElement } from 'lwc';
import wireMethodWithParam from 'c/wireMethod';
import { registerApexTestWireAdapter } from '@salesforce/lwc-jest';
import getAllCases from '@salesforce/apex/CaseController.getAllCases';
const mockFindCases = require('./data/allcases.json');
const mockFindCasesNoRecords = require('./data/nodata.json');
// Register as Apex wire adapter.
public with sharing class BeerController {
public BeerController() {
}
public static String generateCardId(){
String CharList = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_';
Integer position;
Integer LengthRequired = 30;
String Res = '';
public with sharing class BeerController {
public BeerController() {
}
public static String generateCardId(){
String CharList = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_';
Integer position;
Integer LengthRequired = 30;
String Res = '';
import { LightningElement, api } from 'lwc';
export default class AddressComponent extends LightningElement {
@api address;
handleSelect(){
const addressEev = new CustomEvent(
'address',
{
detail : this.address.Id
public with sharing class BeerController {
public BeerController() {
}
public static String generateCardId(){
String CharList = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_';
Integer position;
Integer LengthRequired = 30;
String Res = '';