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
/* | |
// Example implementation as follows: | |
public class AWSS3_GetService extends AWS { | |
public override void init() { | |
endpoint = new Url('https://s3.amazonaws.com/'); | |
resource = '/'; | |
region = 'us-east-1'; | |
service = 's3'; | |
accessKey = 'my-key-here'; | |
method = HttpMethod.XGET; |
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 ActionPollerExample implements Database.Batchable<Integer>, Iterator<Integer>, Iterable<Integer> { | |
Integer counter; | |
public Id jobId { get; set; } | |
public Boolean keepPolling { get; set; } | |
public ActionPollerExample() { | |
counter = 0; | |
keepPolling = false; | |
} | |
public Iterator<Integer> iterator() { |
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 Scheduled implements Schedulable { | |
@TestVisible static Boolean executed = false; | |
public void execute(SchedulableContext c) { | |
executed = 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 Documents { | |
public Document[] getDocuments() { | |
return [SELECT Name, BodyLength FROM Document]; | |
} | |
} |
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 OpportunityController { | |
public Opportunity[] getOpps() { | |
return [SELECT Name, Amount FROM Opportunity LIMIT 10]; | |
} | |
} |
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
trigger Obj1 on Obj1 (after insert, after update) { | |
Obj1Trigger.handle(Trigger.new); | |
} |
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 Code39Controller { | |
// Determines if the check digit should be generated | |
// If true, scanners must be enabled to use it | |
public Boolean shouldCheckDigit { get; set; } | |
// The source string to use. Currently only supports | |
// the characters in the "keys" string. Do not use '*'. | |
public String sourceCodeValue { get; set; } | |
// The index for supported characters. | |
static String keys = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*'; |
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 Utils { | |
static Boolean validId(String recordIdString) { | |
try { | |
Id recordId = (Id)recordIdString; | |
String sobjectName = String.valueOf(recordId.getSObjectType()); | |
return Database.countQuery('SELECT COUNT() FROM '+sobjectName+' WHERE Id = :recordId') > 0; | |
} catch(Exception e) { | |
return false; | |
} | |
} |
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
trigger updateContatoPonto on Ponto__c (before insert, before update) { | |
Map<Integer, Id> contactsByNumber = new Map<Integer, Id>(); | |
for(Ponto__c record: Trigger.new) { | |
if(record.Inscricao_Number__c != null) { | |
contactsByNumber.put(record.Inscricao_Numero__c.intValue(), null); | |
} | |
} | |
// Ignore null | |
contactsByNumber.remove(null); |
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 FiveStarsController { | |
public Integer rating { get; set; } | |
} |
OlderNewer