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 OpportunityTriggerHandler extends TriggerHandler { | |
private Map<Id, Opportunity> newOpportunityMap = new Map<Id, Opportunity>(); | |
private Map<Id, Opportunity> oldOpportunityMap = new Map<Id, Opportunity>(); | |
private List<Opportunity> triggerNew = new List<Opportunity>(); | |
private List<Opportunity> triggerOld = new List<Opportunity>(); | |
public OpportunityTriggerHandler() { | |
this.triggerNew = (List<Opportunity>) Trigger.new; | |
this.triggerOld = (List<Opportunity>) Trigger.old; |
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
{{#each this.product.prodBean.subscriptionLabels}} | |
{{this}} | |
{{/each}} | |
//Iterate over a seperate array, but with same length. | |
//returns empty string for each subscription label, when it should return some text | |
{{#each this.product.prodBean.subscriptionDurations}} | |
{{this.product.prodBean.subscriptionLabels.[{{@index}}]}}] | |
{{/each}} |
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 Account createPortalAccount(){ | |
User u = [Select Id From User Where Id=:UserInfo.getUserId()]; | |
Id roleId = [Select Id From UserRole Where PortalType='None' Limit 1].Id; | |
User accountOwner = null; | |
System.runAs(u){ | |
Map<String,Object> acctOwnerInputParams = new Map<String,Object>(); | |
acctOwnerInputParams = new Map<String,Object>(); | |
acctOwnerInputParams.put('UserRoleId',roleId); | |
acctOwnerInputParams.put('Username','batmanowner@wayneenterprises.com'); |
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
<!-- LDS markup for a checkbox (https://www.lightningdesignsystem.com/components/forms/) --> | |
<div class="slds-form-element margintop10"> | |
<label class="slds-checkbox" for="requiredCheckbox"> | |
<ui:inputCheckbox aura:Id="requiredCheckbox" value="{!v.selectedFormObject.Required_On_Form__c}" /> | |
<span class="slds-checkbox--faux" /> | |
<span class="slds-form-element__label marginleft10">Required on Form?</span> | |
</label> | |
</div> |
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:commandLink action="{!downloadTemplate}" target="blank" value="Download CSV Template" /> |
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
private Map<String,Set<String>> parseCsv(Integer numRecords){ | |
//csvFile is public Blob member variable... | |
String csvData = csvFile.ToString(); | |
csvData = csvData.replace('"',''); | |
List<String> records = csvData.split('\r?\n'); | |
Map<String,Set<String>> ans = ... | |
//Start at 1 to skip header row | |
for(Integer i=1; i < records.size() && (numRecords == null || i <= numRecords); i++){ |
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 Controller code | |
public List<SelectOption> filterCriteria{ | |
get{ | |
//TODO change the names to labels | |
List<SelectOption> options = new List<SelectOption>(); | |
for(Account a : [Select Name,Value__c From Account Limit 10]){ | |
options.add(new SelectOption(a.Value__c,a.Name); | |
} | |
return options; | |
} |
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
for (int i=0; i< saveResults.length; i++) { | |
if (saveResults[i].isSuccess()) { | |
System.out.println(i+". Successfully deleted record - Id: " + saveResults[i].getId()); | |
} else { | |
Error[] errors = saveResults[i].getErrors(); | |
for (int j=0; j< errors.length; j++) { | |
System.out.println("ERROR deleting record: " + errors[j].getMessage()); | |
} | |
} |
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
//sobjList is my array of records inserted.. | |
this.currentIndex = 0; | |
for(Database.SaveResult sr : Database.insert(objects,false)){ | |
if(!sr.success){ | |
exceptions.add(createException(batchId,sr.getErrors().get(0),sobjList.get(currentIndex))); | |
} | |
currentIndex++; | |
} |
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="false" standardController="Trial__c" extensions="PAM1_ProvisioningLoginTrial"> | |
<head> | |
<apex:includeScript value="{!URLFOR($Resource.jquerymin182, '/jquery-1.8.2.min.js')}" /> | |
<script> | |
$j = jQuery.noConflict(); | |
$j.post("{!url}", { username: "{!username}", password: "{!password}" }, | |
function(data) { | |
if(data) { | |
window.href('{!url}'); | |
} |
OlderNewer