Skip to content

Instantly share code, notes, and snippets.

View rahulmalhotra's full-sized avatar
😃
Working on something amazing...!!

Rahul Malhotra rahulmalhotra

😃
Working on something amazing...!!
View GitHub Profile
@rahulmalhotra
rahulmalhotra / local-dev-server-lwc
Created July 2, 2021 10:33
Command to install lwc local dev server
sfdx plugins:install @salesforce/lwc-dev-server
@rahulmalhotra
rahulmalhotra / gist:f520d28af6f2573eeef74fa59ff92d48
Last active May 15, 2021 05:52
Updated Start method of batch class used in SFDC Stop UNABLE_TO_LOCK_ROW blog
public Database.QueryLocator start(Database.BatchableContext bc) {
return Database.getQueryLocator('SELECT Id, Count__c FROM Product_Part__c ORDER BY Product__c');
}
@rahulmalhotra
rahulmalhotra / batch-class-execute.cls
Created May 15, 2021 05:22
Execute method of batch class used in SFDC Stop UNABLE_TO_LOCK_ROW blog
public void execute(Database.BatchableContext bc, List<SObject> records) {
List<Product_Part__c> productParts = (List<Product_Part__c>) records;
for(Product_Part__c productPart : productParts) {
productPart.Count__c = 100;
}
update productParts;
}
@rahulmalhotra
rahulmalhotra / batch-class-start.cls
Last active May 15, 2021 05:51
Start method of batch class used in SFDC Stop UNABLE_TO_LOCK_ROW blog
public Database.QueryLocator start(Database.BatchableContext bc) {
return Database.getQueryLocator('SELECT Id, Count__c FROM Product_Part__c');
}
@rahulmalhotra
rahulmalhotra / classes-part-3.js
Created February 21, 2021 07:12
This code snippet is used in ES6 Classes JavaScript Tutorial on SFDC Stop
class Car {
#color
constructor(name, speed, color) {
this.name = name;
this.speed = speed;
this.#color = color;
}
@rahulmalhotra
rahulmalhotra / classes-part-2.js
Created February 17, 2021 04:05
This code snippet is used in ES6 Classes JavaScript Tutorial on SFDC Stop
class Car {
constructor(name, speed) {
this.name = name;
this.speed = speed;
}
showSpeed() {
console.log(this.speed);
}
@rahulmalhotra
rahulmalhotra / classes-part-1.js
Created February 17, 2021 03:39
This code snippet is used in ES6 Classes JavaScript Tutorial on SFDC Stop
function Car(name, speed) {
this.name = name;
this.speed = speed;
}
Car.prototype.showSpeed = function() {
console.log(this.speed);
}
let audi = new Car('audi', 200);
@rahulmalhotra
rahulmalhotra / spreadoperator-part-5.js
Created January 21, 2021 11:46
This code snippet is used in ES6 Spread Operator JavaScript Tutorial by SFDC Stop
let features = ['Great Speed', 'Good Color', 'Comfort', 'Good Looks'];
let moreFeatures = ['Great Mileage', 'Amazing Design', ...features];
console.log(moreFeatures);
@rahulmalhotra
rahulmalhotra / spreadoperator-part-4.js
Created January 21, 2021 11:28
This code snippet is used in ES6 Spread Operator JavaScript Tutorial by SFDC Stop
let features = ['Great Speed', 'Good Color', 'Comfort', 'Good Looks'];
let moreFeatures = ['Great Mileage', 'Amazing Design'];
features.push(...moreFeatures);
@rahulmalhotra
rahulmalhotra / spreadoperator-part-3.js
Created January 21, 2021 11:16
This code snippet is used in ES6 Spread Operator JavaScript Tutorial by SFDC Stop
// * Rest Parameters
function car(name, ...features) {
console.log('Features of Car ' + name + ' are:- ');
features.forEach(feature => {
console.log(feature);
});
}
car('Audi', 'Great Speed', 'Good Color', 'Comfort', 'Good Looks');