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
handleButtonClick: function(component, event,helper){ | |
...... | |
} |
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
({ | |
fetchCases(component, event, helper){ | |
helper.getCases(component); | |
} | |
}) |
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 AccountHelper { | |
@future | |
public static void updateAccounts(Boolean value,List<Id> accountIds){ | |
List<Account> allAccounts = [SELECT ID,notifyAdmin__c FROM ACCOUNT WHERE ID IN: accountIds]; | |
for(Account anAccount : allAccounts){ | |
anAccount.notifyAdmin__c=value; | |
} | |
if(allAccounts.size() > 0){ | |
update allAccounts; | |
} |
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
@isTest | |
public class TestAccountHelper { | |
public static Account clientAcc; | |
public static string salesforceLicenseId = [SELECT Id FROM profile WHERE Profile.UserLicense.Name='Salesforce' limit 1].id; | |
public static Market_Area__c Markt; | |
public static User salesforceLicUser; | |
private static void createUsers(){ | |
salesforceLicUser = new User( | |
Alias = 'standt', |
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 HelloWorld { | |
public String calculateDistance(){ | |
Integer distance = calculateDistanceBetweenAB() + | |
calculateDistanceBetweenBC() + | |
calculateDistanceBetweenCD() + | |
calculateDistanceBetweenDA(); | |
if(distance > 100){ | |
return 'You should go by flight'; | |
}else{ |
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 EmployeeMap { | |
public void createEmployeeMapAndDisplay(){ | |
Map<Integer, String> employeeMap = new Map<Integer, String>(); | |
employeeMap.put(1, 'James'); | |
employeeMap.put(2, 'Sudipta'); | |
employeeMap.put(3, 'Christiaan'); | |
employeeMap.put(4, 'Victor'); | |
for(Integer index : employeeMap.keySet()){ | |
System.Debug('Index: ' + index + ' Employee: ' + employeeMap.get(index)); |
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 DistanceOperation { | |
public static void calculateDistance(){ | |
Double myCurrentLocationLatitude = 10.20; | |
Double myCurrentLocationLongitude = 10.20; | |
List<Account> allAccounts = [SELECT ID FROM ACCOUNT WHERE | |
DISTANCE(Head_Office_Location__c, | |
GEOLOCATION(:myCurrentLocationLatitude, :myCurrentLocationLongitude),'mi') < 1]; | |
if(allAccounts.size() > 0){ | |
System.Debug('Total number of accounts: ' + allAccounts.size()); | |
}else{ |
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 MyCustomType { | |
public Integer myField {get;set;} | |
} |
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
@isTest | |
public class TestEqualOperator { | |
static testMethod void testEqual(){ | |
MyCustomType myCustomType1 = new MyCustomType(); | |
myCustomType1.myField = 10; | |
MyCustomType myCustomType2 = new MyCustomType(); | |
myCustomType2.myField = 10; | |
System.assertEquals(true, myCustomType1 == myCustomType2, 'Expected value is 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 class MyCustomType { | |
public Integer myField {get;set;} | |
public Boolean equals(Object o){ | |
if(this === o){ | |
return true; | |
} | |
if(!(o instanceof MyCustomType)){ | |
return false; | |
}else{ |
OlderNewer