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
// tJavaRow: | |
java.util.List<String> oppids; | |
if (!globalMap.containsKey("oppids")) { | |
oppids = new java.util.ArrayList<String>(); | |
} else { | |
oppids = (java.util.List<String>) globalMap.get("oppids"); | |
} | |
if (input_row.AS_External_ID__c != null && !input_row.AS_External_ID__c.equals("")) { |
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
String dateUpdatedQueryString = ""; | |
Integer numberOfDays = (Integer) context.NumberOfDays; | |
SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); | |
if (numberOfDays != null && numberOfDays > 0) { | |
java.util.Calendar today = java.util.Calendar.getInstance(); | |
today.setTime(new Date()); | |
today.add(java.util.Calendar.DATE, -numberOfDays); | |
dateUpdatedQueryString = "&DateUpdated[after]=" + DATE_FORMAT.format(today.getTime()); | |
System.out.println("dateUpdatedQueryString: " + dateUpdatedQueryString); |
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
SELECT | |
ocr.ContactId, | |
ocr.OpportunityCloseDate, | |
ocr.OpportunityAmount, | |
LAG(ocr.OpportunityCloseDate, 1) OVER (PARTITION BY ocr.ContactId ORDER BY ocr.OpportunityCloseDate ASC) AS `Prev` | |
FROM | |
`OpportunityContactRoles` AS ocr | |
WHERE | |
ocr.OpportunityAmount > 0 | |
ORDER BY |
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 static String getIconName(String sObjectName){ | |
String u; | |
List<Schema.DescribeTabSetResult> tabSetDesc = Schema.describeTabs(); | |
List<Schema.DescribeTabResult> tabDesc = new List<Schema.DescribeTabResult>(); | |
List<Schema.DescribeIconResult> iconDesc = new List<Schema.DescribeIconResult>(); | |
for(Schema.DescribeTabSetResult tsr : tabSetDesc) { tabDesc.addAll(tsr.getTabs()); } | |
for(Schema.DescribeTabResult tr : tabDesc) { | |
if( sObjectName == tr.getSobjectName() ) { |
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
global class AFFL_AffiliationsStartDate_TDTM extends npsp.TDTM_Runnable { | |
global override npsp.TDTM_Runnable.DmlWrapper run(List<SObject> newlist, | |
List<SObject> oldlist, | |
npsp.TDTM_Runnable.Action triggerAction, | |
Schema.DescribeSObjectResult objResult) { | |
npsp.TDTM_Runnable.dmlWrapper dmlWrapper = new npsp.TDTM_Runnable.DmlWrapper(); | |
List<npe5__Affiliation__c> newAffils = (List<npe5__Affiliation__c>) newlist; | |
List<npe5__Affiliation__c> oldAffils = (List<npe5__Affiliation__c>) oldlist; |
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
// If not the "System" user or a System Administrator, then do the thing.... | |
!OR( | |
AND( | |
$User.FirstName == '', | |
$User.LastName == 'System' | |
), | |
$Profile.Name == 'System Administrator' | |
) |
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
// Visualforce Page: MySU_Redirect_Page | |
<apex:page controller="MySURedirectController" action="{!redirect}"/> | |
// Apex Controller: | |
public class MySURedirectController { | |
public PageReference redirect() { | |
Id serviceRecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('LCC').getRecordTypeId(); | |
Map<String,String> getParams = ApexPages.currentPage().getParameters(); | |
String serviceId = getParams.get('service_id'); |
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
package routines; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Random; | |
public class MyHelper { | |
/** |