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
// The step is the distance between each label on the y axis | |
public Integer calculateStepSize(Integer highestVal) | |
{ | |
//calculates the appropriate step to display on the y axis | |
List<Integer> possibleSteps = New Integer[]{1,2,5,10,20,50}; | |
for(Integer i= (possibleSteps.size() - 1);i >= 0; i--) { | |
System.debug('HIGH DIV 6:' + (highestVAl / 6) + ' POSS STEP:' + possibleSteps[i]); | |
if ((highestVal / 6) > possibleSteps[i]) | |
return possibleSteps[i]; | |
} |
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
host = ApexPages.currentPage().getHeaders().get('Host'); | |
Integer startIndex = siteUrl.indexOf(host) + host.length() + 1; | |
Integer endIndex = siteUrl.lastIndexOf('/'); | |
System.debug('si:' + startIndex + 'ei: ' + endIndex); | |
if(startIndex < endIndex && startIndex != -1) | |
extension = siteUrl.substring(startIndex,endIndex); | |
else | |
extension = ''; | |
if(extension != 'apex') | |
testUrl2 = siteUrl.substring(0, startIndex) + extension + System.Page.largeLookup.getUrl(); |
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
//prototype only. Does not actually work yet... | |
public with sharing class SObjectUtils { | |
//Does not support fields with multiple reference object types | |
public SObject deepClone(SObject so) { | |
SObject newSO = so.clone(false,true); | |
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 void getLabelsAndWidthsfromFields(List<String> fieldNames, String objectName) | |
{ | |
labels = new List<String>(); | |
widths = new List<String>(); | |
try { | |
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe(); | |
SObjectType sot = gd.get(objectName); | |
Map<String, SObjectField> fields = sot.getDescribe().fields.getMap(); | |
List<SObjectField> fieldtokens = fields.values(); |
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 with sharing class TaskWrapper { | |
public Boolean markedComplete { get; set; } | |
public Boolean markedIncomplete { get; set; } | |
public Boolean markedReviewed { get; set; } | |
public Boolean created { get; set; } | |
public String assignedTo { get; set; } | |
//public Boolean markedReviewedIncomplete { get; set; } | |
public NewsFeed taskFeedItem { get; set; } | |
public Integer commentCount { get; set; } |
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
class ChatPostWrapper { | |
Chat_Session__Feed post; | |
public String postBody { get; set; } | |
public String userHandle { get; set; } | |
public String createdDate { get; set; } | |
public Boolean newPost { get; set; } | |
public Boolean systemMessage { get; private set; } | |
public List<FeedComment> comments { get; set; } |
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
//http://www.force2b.net/index.php/2010/08/date-time-and-timezone-handling-in-apex/ | |
/* ********************************************************************************************** | |
* TimeConversions Class | |
* Created by: Michael Smith/Force2b, 04/06/2010 | |
* | |
************************************************************************************************ */ | |
global class TimeConversions { | |
/* ------------------------------------------------------------------------------------- |
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 delete, after insert, after undelete, | |
after update, before delete, before insert, before update) { | |
AccountTriggerHandler handler = new AccountTriggerHandler(Trigger.isExecuting, Trigger.size); | |
if(Trigger.isInsert && Trigger.isBefore){ | |
handler.OnBeforeInsert(Trigger.new); | |
} | |
else if(Trigger.isInsert && Trigger.isAfter){ | |
handler.OnAfterInsert(Trigger.new); | |
AccountTriggerHandler.OnAfterInsertAsync(Trigger.newMap.keySet()); |
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 with sharing class AccountTriggerHandler { | |
private boolean m_isExecuting = false; | |
private integer BatchSize = 0; | |
public AccountTriggerHandler(boolean isExecuting, integer size){ | |
m_isExecuting = isExecuting; | |
BatchSize = size; | |
} | |
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 with sharing class AccountTriggerHandler { | |
private boolean m_isExecuting = false; | |
private integer BatchSize = 0; | |
public AccountTriggerHandler(boolean isExecuting, integer size){ | |
m_isExecuting = isExecuting; | |
BatchSize = size; | |
} | |