This file contains 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 static void publishNotifications(List<String> messages){ | |
List<Notification__e> notifications = new List<Notification__e>(); | |
for (String message: messages) { | |
notifications.add(new Notification__e(Message__c = message)); | |
} | |
List<Database.SaveResult> results = EventBus.publish(notifications); | |
//process results | |
This file contains 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
pchittum-ltm:dreamhouse-wt pchittum$ sfdx force:apex:test:run -u dreamhouse -d deploy -r human -c | |
Listening for results | |
Invoking Apex tests using dreamhouse... | |
Started async test run job: 7075800002GiN0g | |
Test run id written to deploy/test-run-id.txt | |
Processing event for job 7075800002GiN0gAAF | |
Processing event for job 7075800002GiN0gAAF | |
Processing event for job 7075800002GiN0gAAF | |
Processing event for job 7075800002GiN0gAAF | |
Processing event for job 7075800002GiN0gAAF |
This file contains 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
//alternative or additional query to show sub query that is not unbounded | |
for(Account a : [SELECT Id,Name | |
FROM Account | |
WHERE Id IN :Trigger.New | |
AND Id NOT IN (SELECT AccountId | |
FROM Opportunity | |
WHERE AccountId in : Trigger.New)]){ | |
System.debug(a); | |
} |
This file contains 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
for n <- 1..20 do | |
cond do | |
rem(n, 15) == 0 -> "fizzbuzz" | |
rem(n, 5) == 0 -> "buzz" | |
rem(n, 3) == 0 -> "fizz" | |
true -> n | |
end | |
end |
This file contains 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
<apex:page standardController="Position__c" title="Sample Position Layout Page" showHeader="true" sidebar="true" > | |
<apex:sectionHeader title="{!$ObjectType.Position__c.label} Edit" subtitle="New Position"/> | |
<chatter:feedWithFollowers entityId="{!Position__c.id}"/> | |
<apex:form id="theForm"> | |
<!--this is the level I am rerendering at...including all sections and children-->? | |
<apex:pageBlock title="Position Detail" mode="edit" id="thePageBlock"> | |
<apex:pageBlockButtons > | |
<apex:commandButton value="Save" action="{!save}"/> | |
<apex:commandButton value="Cancel" action="{!cancel}" immediate="true"/> |
This file contains 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 with sharing class AccountViewEditService { | |
@AuraEnabled | |
public static Account fetchAccount(Id acctId){ | |
Account newAcct; | |
try { | |
System.debug('querying for account id: ' + acctId); | |
newAcct = [SELECT Id, Name, Type, ParentId, BillingStreet, BillingCity, BillingState, | |
BillingPostalCode, BillingCountry, BillingLatitude, BillingLongitude, | |
BillingGeocodeAccuracy, Phone, Fax, AccountNumber, Website, PhotoUrl, |
This file contains 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
In what country do you currently reside? | |
United States | |
What city or town do you live in? | |
Houston | |
How old are you? | |
<20 | |
What is your gender? | |
Male | |
Tabs or Spaces? | |
Spaces |
This file contains 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
In what country do you currently reside? | |
United States | |
What city or town do you live in? | |
Houston | |
How old are you? | |
<20 | |
What is your gender? | |
Male | |
Tabs or Spaces? | |
Spaces |
This file contains 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 ComponentController { | |
public Id myId {get;set;} | |
public Expense__c exp { | |
get { | |
if (exp == null) { | |
exp = [select Id,Name,Amount__c from Expense__c where id =: myId]; | |
} | |
return exp; |
This file contains 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
({ | |
doInit: function(component, evt, helper) { | |
console.log('entered init'); | |
var action = component.get("c.getAccount"); | |
console.log('Apex METHOD:') | |
console.log(action); | |
action.setCallback(this, function(a) { | |
console.log('entered callback'); |