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 PO_Approval_Milestones_Helper_Class { | |
// Test Class: Global_Test_Class | |
public static void addTime(List<PO_Approval_Milestones__c> newTrigger){ | |
// Class to calculate the difference in Start and Completed Date/Time Fields | |
// Doing it at the PO Approval Milestone level in order to cut down on the redundent and complex queries | |
// 08Dec2017 - ESC | |
Id bhId; | |
Id bhDefaultId; |
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 master_Latam_Sales_Transactions on Latam_Sales_Transactions__c (before insert, before update) { | |
// Lines 7-11 are just FYI debug in case there are recursive issues but otherwise are | |
// not needed and can be deleted. | |
if( | |
(Trigger.isUpdate || Trigger.isInsert) && | |
Trigger.isBefore | |
){ | |
String triggerType = 'Update'; | |
if(Trigger.isInsert){ | |
triggerType = 'Insert'; |
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:page standardController="Complaint__c" sidebar="false" title="{!Complaint__c.Name}" showHeader="false"> | |
<apex:form > | |
<br/> | |
<!--<br/><u><a href="/{!Complaint__c.Id}">Return to {!Complaint__c.Name}</a></u> - | |
<apex:commandLink value="Click for Printable View" onclick="window.print();"/> --> | |
<apex:commandbutton value="<-- Click to Return to {!Complaint__c.Name}" action="/{!Complaint__c.Id}" /> | |
<apex:commandButton onclick="window.print();" value="Print Compliant" /> | |
<apex:detail subject="{!Complaint__c.Id}" relatedList="false" title="false"/> | |
</apex:form> | |
</apex:page> |
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 static void setBUKey(List<Business_Metrics__c> newTrigger){ | |
String buKeyList; | |
String buKey; | |
Map<String,Business_Unit__c> buMap = Business_Unit__c.getAll(); | |
for(Business_Metrics__c bmx : newTrigger){ | |
buKey = NULL; | |
if(bmx.Business_Unit__c != NULL){ | |
buKeyList = bmx.Business_Unit__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
// This displays the list of users that are active and 'Frozen' in Salesforce.com | |
SELECT Name, IsActive, LastLoginDate, Id, username FROM User WHERE IsActive = TRUE AND Id IN (SELECT userId FROM userLogin WHERE IsFrozen = 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
map<String, Schema.SObjectField> sMap = Schema.SObjectType.Account.fields.getMap(); | |
map<String, String> fieldMap = new map<String, String>(); | |
for(String s : sMap.keySet()) | |
{ | |
fieldMap.put(sMap.get(s).getDescribe().getLabel(), sMap.get(s)); | |
system.debug('Field Name: ' + sMap.get(s).getDescribe().getLabel() + ' - API Name: ' + sMap.get(s)); | |
} |
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 One - Create the User and run tests under that user | |
Profile p = [select id from profile where name='System Administrator']; | |
User u = new User( | |
alias = 'abc123xyz', | |
email='[email protected]', | |
emailencodingkey='UTF-8', | |
firstname='Sam', | |
lastname='Franks', | |
languagelocalekey='en_US', | |
localesidkey='en_GB', |
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:page showHeader="true" standardController="Account" sidebar="true"> | |
<p> | |
<b><a href="/{!Account.Id}">{!Account.Name}</a></b> | |
</p> | |
<wave:dashboard dashboardId="0FKn00000004E86GSA" <!-- Fake ID - Use your assetId from Share URL --> | |
showTitle="false" | |
showSharing="false" | |
height="1800px" | |
openLinksInNewWindow="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
Here is the code example straight from the documentation that does not work: | |
filter="{'Sales_YOY': {'Account__c': ['{!Account.Id}']}}" | |
Here is the code from the 'bug' page that works: | |
filter="{'datasets':{'Sales_YOY':[{'fields':['Account__c'], 'filter':{'operator': 'matches', 'values':['{!Account.Id}']}}]}}" | |
Here is the code that works for multiple datasets: | |
filter="{'datasets':{ | |
'Sales_YOY':[{'fields':['Account__c.Id'], 'filter':{'operator': 'matches', 'values':['{!Account.Id}']}}], | |
'Sales_Daily':[{'fields':['Account__c.Id'], 'filter':{'operator': 'matches', 'values':['{!Account.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
q = load "0Fb44000000btGwCAI/0Fc44000000cKRmCAM"; | |
q = filter q by 'Compensatory__c' == "true" && 'Business_Unit__c' == ""; | |
q = group q by ('Business_Unit__c', 'New_Product_Tracking_Name__c'); | |
q = foreach q generate 'Business_Unit__c' as 'BU', 'New_Product_Tracking_Name__c' as 'NPT', sum('Sales__c') as 'Total_Sales'; | |
q = order q by ('BU' asc, 'NPT' asc); | |
o = load "opportunity"; | |
o = filter o by 'IsClosed' == "false"; | |
o = filter o by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["current year".."current year"]; | |
o = group o by ('Business_Unit_Formula__c', 'New_Product_Tracking_Name__c'); |