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
/* Various features of the Salesforce1 platform require Apex to utilize specific interfaces so the a level of | |
functionality can be assumed. One of these is the inbound email interface. This allows Apex to be used as an | |
email service which can process incoming emails. | |
To complete this extra credit: | |
1. Create an Apex class that uses the Inbound Email interface using the code below | |
2. Complete the acceptEmail function so that it returns an email with more information on the product | |
3. Add the Apex class as an email service and test it manually. | |
*/ |
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 BlogLog_Services implements Messaging.InboundEmailHandler { | |
public BlogLog_Services() {} | |
public Document document { | |
get { | |
if (document == null) | |
document = new Document(); | |
return document; | |
} |
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 with sharing class FlickrHandler { | |
public class FlickrList { | |
public string title {get; set;} | |
public string link {get; set;} | |
public List<FlickrData> items {get; set;} | |
} | |
public class FlickrData { | |
public string title {get; set;} |
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 OpportunitiesController { | |
public List<Opportunity> opportunities {get; set;} | |
public OpportunitiesController() { | |
opportunities = [SELECT Id, Name, Account.Name, ExpectedRevenue, CloseDate from Opportunity WHERE OwnerId = :UserInfo.getUserId()]; | |
} | |
} |
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
//NewProj2 isn't a meaningful Apex name. NewProjectTrigger? | |
trigger NewProj2 on Opportunity (before update) { | |
for (Opportunity o : Trigger.new) | |
{ | |
if(o.StageName == 'Closed Won') | |
{ | |
try | |
{ | |
SFL5_Projects__c[] proj = [Select Name From SFL5_Projects__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
<script src="https://bit.ly/vf_ios_js"></script> |
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 VerifyDate { | |
//method to handle potential checks against two dates | |
public static Date CheckDates(Date date1, Date date2) { | |
//if date2 is within the next 30 days of date1, use date2. Otherwise use the end of the month | |
if(DateWithin30Days(date1,date2)) { | |
return date2; | |
} else { | |
return SetEndOfMonthDate(date1); | |
} |
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 RestrictContactByName on Contact (before insert, before update) { | |
//check contacts prior to insert or update for invalid data | |
For (Contact c : Trigger.New) { | |
if(c.LastName == 'INVALIDNAME') { //invalidname is invalid | |
c.AddError('The Last Name "'+c.LastName+'" is not allowed for DML'); | |
} | |
} |
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
<aura:component> | |
<ui:inputPhone aura:id="phone" label="phone" /> | |
<ui:button label="Show Phone" /> | |
</aura:component> |
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 DisplayCaseController { | |
@AuraEnabled | |
public static Case getCaseFromId(Id caseID) { | |
if(caseID == null) { | |
return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1]; | |
} | |
List<Case> cases = [ SELECT Id, Subject, Description, Status from CASE where ID = :caseID ]; | |