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
IF( | |
OR( | |
ISBLANK(Available_From__c) | |
,Available_From__c < CASE( | |
MOD(TODAY() - DATE( 1900, 1, 7 ), 7 ), | |
2, TODAY() + 2 + 4, | |
3, TODAY() + 2 + 4, | |
4, TODAY() + 2 + 4, | |
5, TODAY() + 2 + 4, | |
6, TODAY() + 1 + 4, |
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
/** | |
* @description determines the namespace prefix of the managed package | |
*/ | |
public static String getNamespacePrefix(DescribeFieldResult fr){ | |
String prefix = null; | |
String fieldName = fr.getName(); | |
String localname = fr.getLocalName(); | |
Integer idx = fieldName.indexOf(localname); |
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:repeat var="fs" value="{!$ObjectType.Lead.FieldSets.My_Fs}"> | |
<apex:inputField value="{!currentLead[fs]}" rendered="{!editableFields[fs.fieldPath]}" required="{!fs.required}" /> | |
<apex:outputField value="{!currentLead[fs]}" rendered="{!NOT(editableFields[fs.fieldPath])}" /> | |
</apex:repeat> |
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
Map<String,String> strMap = new Map<String,String>(); | |
strMap.put('pig','lowercasepig'); | |
strMap.put('PIG','uppercasepig'); | |
strMap.put('PiG','mixedCasePig'); | |
//spits out 3 | |
System.debug(strMap.size()); | |
//spits out 3 | |
System.debug(strMap.keySet().size()); | |
for(String str : strMap.values()){ | |
//Spits out 3 different values, 1 at a time |
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
PageReferene pageRef = Page.BigMachines__QuoteEdit; | |
Map<String,String> parms = pageRef.getParameters(); | |
//Get First (Primary) Big Machine Quote From current Opportunity's parent opportunity | |
parms.put('Id',parentOpp.BigMachines__BigMachines_Quotes__r.get(0).Id); | |
//Clone the parent into the the current aka child opportunity. | |
parms.put('oppId',opp.Id); |
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
/** | |
* ManagedPackageUtils | |
* @description Utility class for finding info out regarding managed package | |
* @author James Loghry | |
* @date 2/12/2013 | |
*/ | |
public class ManagedPackageUtils{ | |
/** | |
* @description determines the namespace prefix of the managed package |
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 mytrigger on object(before update){ | |
for(Object current : Trigger.new){ | |
Object olObject = Trigger.oldMap.get(current.Id); | |
if(olObject.MyField__c != current.MyField__c && otherConditionsGoHere){ | |
//Option1 | |
olObject.MyField__c.addError('Cannot do that, Hal..'); | |
//Option2 | |
current.MyField__c = olObject.MyField__c; | |
} | |
} |
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
global class MySchedulableClass implements Schedulable{ | |
global void execute(SchedulableContext sc){ | |
Database.execute(new MyBatchClass()); | |
} | |
} |
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
/** | |
* ContactsCtrl | |
* @description Apex and stuff.. | |
* @author | |
* @date 11/21/2016 | |
*/ | |
public with sharing class ContactsCtrl { | |
@AuraEnabled | |
public static List<Contact> getContacts(){ |
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 InvocableDebugger{ | |
@InvocableMethod | |
public static void debugMessage(List<String> messages){ | |
for(String str : messages){ | |
System.debug(str); | |
} | |
} | |
} |