This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "SFDX: Retrieve Metadata From Package", | |
"type": "shell", | |
"command": "sfdx", | |
"args": [ | |
"force:source:retrieve", | |
"-n", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String csv = 'Id,Name\n'; | |
for ( List<Account> accts : [ SELECT id, name FROM Account LIMIT 10 ] ) { | |
for ( Account acct : accts ) { | |
csv += acct.id + ',' + acct.name.escapeCsv() + '\n'; | |
} | |
} | |
ContentVersion file = new ContentVersion( | |
title = 'accounts.csv', | |
versionData = Blob.valueOf( csv ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement } from 'lwc'; | |
import { ShowToastEvent } from 'lightning/platformShowToastEvent'; | |
import { loadScript, loadStyle } from 'lightning/platformResourceLoader'; | |
import ChatResource from '@salesforce/resourceUrl/Chat_Application_LWC'; | |
export default class Chat_Application extends LightningElement { | |
renderedCallback() { | |
Promise.all([ | |
loadScript(this, ChatResource + '/js/jquery.min.js'), | |
loadScript(this, ChatResource + '/js/jquery.mCustomScrollbar.min.js'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global class AccountEmailService implements Messaging.InboundEmailHandler { | |
//describe call on Account object to fetch all fields and their Data type | |
public static Schema.DescribeSObjectResult objectDescribe = Account.getSObjectType().getDescribe(); | |
public static Map<String, Schema.SObjectField> fields; | |
static{ | |
fields = objectDescribe.fields.getMap(); | |
} | |
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sfdx force:doc:commands:list | |
=== Commands | |
force:alias:list # list username aliases for sfdx | |
force:alias:set # set username aliases for sfdx | |
force:apex:class:create # create an apex class | |
force:apex:execute # execute anonymous apex code | |
force:apex:log:get # fetch a debug log | |
force:apex:log:list # list debug logs | |
force:apex:test:report # display test results | |
force:apex:test:run # invoke apex tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger AccountTrigger on Account ( before insert, before update, before delete, | |
after insert, after update, after delete ) { | |
AccountTriggerHandler handler = new AccountTriggerHandler(); | |
if ( Trigger.isBefore && Trigger.isInsert ) { | |
handler.handleBeforeInsert( Trigger.new ); | |
} | |
else if ( Trigger.isBefore && Trigger.isUpdate ) { | |
handler.handleBeforeUpdate( Trigger.old, Trigger.oldMap, Trigger.new, Trigger.newMap ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger AccountTrigger on Account (after update) { | |
//prepare an empty Map of ID-to-Account for your updates | |
Map<ID, Account> acctMapToUpdate = new Map<Id, Account>(); | |
//prepare a for-loop you can use to compare old and new field values | |
for(Integer i = 0 ; i < trigger.new.size() ; i++){ | |
Account old = trigger.old[i]; | |
Account nw = trigger.new[i]; | |
//Evaluate Custom Settings to decide whether to execute actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DailyLeadProcessor implements schedulable{ | |
public void execute(schedulableContext sc) { | |
List<lead> l_lst_new = new List<lead>(); | |
List<lead> l_lst = new List<lead>([select id, leadsource from lead where leadsource = null]); | |
for(lead l : l_lst) { | |
l.leadsource = 'Dreamforce'; | |
l_lst_new.add(l); | |
} | |
update l_lst_new; |