SlideShare ist ein Scribd-Unternehmen logo
1 von 82
Salesforce1 Platform
for Programmers
@forcedotcom
@joshbirk
@metadaddy
#forcedotcom
#askforce
David Scruggs Principal Platform Engineer
@davescruggs
In/dscruggs
dscruggs@salesforce.com
Stewart Loewen Solution Strategist
/in/stewartloewen
sloewen@salesforce.com
Safe Harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve
risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com,
inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of
historical fact could be deemed forward-looking, including any projections of subscriber growth, earnings, revenues, or other financial items and any
statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or
upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our
service, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in
our Web hosting, breach of our security measures, risks associated with possible mergers and acquisitions, the immature market in which we operate,
our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service
and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise
customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form
10-K for the most recent fiscal quarter ended July 31, 2011. This document and others are available on the SEC Filings section of the Investor
Information section of our Web site.
Any unreleased services or features referenced in this or other press releases or public statements are not currently available and may not be delivered
on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available.
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Login and get ready
UofM Wireless
Internet Instructions
On Each Table
Be interactive
For the Eclipse fans in the room
Use the Editor
of Your Choice
http://developer.force.com/join
Free Developer Environment
Online Workbook
http://bit.ly/force_apex_book
Salesforce is a Platform Company. Period.
-Alex Williams, TechCrunch
500M
API Calls Per Day6B
Lines of Apex
4M+
Apps Built on
the Platform
72B
Records Stored
Salesforce1 Platform
1.4 million…and growing
Core
Services
Chatter
Multi-
language
Translation
Workbench
Email
ServicesAnalytics
Cloud
Database
Scheema
Builder
Search
Visualforce
MonitoringMulti-tenant
Apex
Data-level
Security
Workflows
APIs
Mobile
Services
Social
APIs
Analytics
APIs
Bulk APIsRest APIs Metadata
APIs
Soap APIs
Private App
Exchange
Custom
Actions
Identity
Mobile
Notifications
Tooling
APIs
Mobile
Packs
Mobile SDK
Offline
Support
Streaming
APIs
Geolocation
ET 1:1 ET Fuel
Heroku1
Heroku
Add-Ons
Sharing
Model
ET API
Salesforce1 Platform
Every Object, Every Field: Salesforce1 Mobile Accessible
AppExchange Apps:
Dropbox Concur Evernote ServiceMax More
Custom Apps and Integrations:
SAP Oracle Everything Custom More
Sales, Service and Marketing
Accounts Cases Campaigns Dashboards More
Your App
Every Object, Every Field: API Enabled
GET
POST
PATCH
DELETE
OAuth 2.0
HTTPS
Every Object, Every Field: Apex and Visualforce Enabled
Visualforce Pages
Visualforce Components
Apex Controllers
Apex Triggers
Custom UICustom UI
Custom LogicCustom Logic
Warehouse Application Requirements
• Track price and inventory on hand for all merchandise
• Create invoices containing one or more merchandise items
as a line items
• Present total invoice amount and current shipping status
Warehouse Data Model
Merchandise
Name Price Inventory
Pinot $20 15
Cabernet $30 10
Malbec $20 20
Zinfandel $10 50
Invoice
Number Status Count Total
INV-01 Shipped 16 $370
INV-02 New 20 $200
Invoice Line Items
Invoice Line Merchandise Units
Sold
Unit Price Value
INV-01 1 Pinot 1 15 $20
INV-01 2 Cabernet 5 10 $150
INV-01 3 Malbec 10 20 $200
INV-02 1 Pinot 20 50 $200
Indexed Field
• Primary Keys
• Id
• Name
• OwnerId
• Audit Dates
• Created Date
• Last Modified Date
• Foreign Keys
• Lookups
• Master-Detail
• CreatedBy
• External ID Fields
• External ID Fields
• Unique Fields
• Fields indexed by Salesforce
Using a query with two or more indexed filters greatly increases performance
Two Approaches to Development
Visualforce Pages
Visualforce Components
Apex Controllers
Apex Triggers
Metadata API
REST API
Bulk API
Formula Fields
Validation Rules
Workflows and Approvals
Custom Objects
Custom Fields
Relationships
Page Layouts
Record Types
User
Interface
Business
Logic
Data
Model
Declarative Approach Programmatic Approach
Declarative before Programmatic
Use declarative features when possible:
• Quicker to build
• Easier to maintain and debug
• Possible addition of new features
• Do not count against governor limits
For example:
• Will a workflow suffice instead of a trigger?
• Will a custom layout work instead of Visualforce?
Warehouse Data Model
Merchandise
Name Price Inventory
Pinot $20 15
Cabernet $30 10
Malbec $20 20
Zinfandel $10 50
Invoice
Number Status Count Total
INV-01 Shipped 16 $370
INV-02 New 20 $200
Invoice Line Items
Invoice Line Merchandise Units
Sold
Unit Price Value
INV-01 1 Pinot 1 20 $20
INV-01 2 Cabernet 5 10 $150
INV-01 3 Malbec 10 20 $200
INV-02 1 Pinot 20 50 $200
Workflow Rule
When inserted, if unit price is blank then fill it with
the Merchandise price value
Hands On Tutorials
#1: Setup your Environment
Apex
Cloud-based programming language on Salesforce1
Introduction to Apex
• Object-Oriented Language
• Dot Notation Syntax
• Cloud based compiling, debugging and unit testing
• “First Class” Citizen on the Platform
public with sharing class myControllerExtension implements Util {
private final Account acct;
public Contact newContact {get; set;}
public myControllerExtension(ApexPages.StandardController stdController) {
this.acct = (Account)stdController.getRecord();
}
public PageReference associateNewContact(Id cid) {
newContact = [SELECT Id, Account from Contact WHERE Id =: cid LIMIT 1];
newContact.Account = acct;
update newContact;
}
}
Apex Anatomy
Class and Interface based Scoped Variables Inline SOQL Inline DML
Developer Console
• Browser Based IDE
• Create and Edit Classes
• Create and Edit Triggers
• Run Unit Tests
• Review Debug Logs
Hands On Tutorials
#2: Using the Dev Console
#3: Creating Apex Classes
Extra Credit:
http://bit.ly/ELEVATE-Apex-Email-EC
Unit Testing
Code which asserts that existing logic is operating correctly
• Code to test code
• Tests can mirror user
expecations
• System Asserts increase
predictability
• Line Coverage increase
predictability
Unit Testing
Unit Testing in Apex
 Built in support for testing
– Test Utility Class Annotation
– Test Method Annotation
– Test Data build up and tear down
 Unit test coverage is required
– Must have at least 75% of code covered
 Why is it required?
Basic Unit Test Structure
@isTest
public class TestClase{
@isTest static void testCase(){
//setup test data
List<Contact> contacts = ContactFactory.createTestContacts();
//process / perform logic
EvaluateContacts.process(contacts);
//assert outcome
System.assertEquals(EvaluateContacts.processed.size(),contacts.size());
}
}
Testing Permissions
//Set up user
User u1 = [SELECT Id FROM User WHERE Alias='auser'];
//Run As U1
System.RunAs(u1){
//do stuff only u1 can do
}
Static Resource Data
List<Invoice__c> invoices = Test.loadData(Invoice__c.sObjectType, 'InvoiceData');
update invoices;
Testing Context and Asynchronous Behavior
// this is where the context of your test begins
Test.StartTest();
//execute future calls, batch apex, scheduled apex
UtilityRESTClass.performCallout();
// this is where the context ends
Text.StopTest();
System.assertEquals(a,b); //now begin assertions
Apex Triggers
• Event Based Logic
• Associated with Object Types
• Before or After:
• Insert
• Update
• Delete
• Undelete
Controlling Flow
trigger LineItemTrigger on Line_Item__c
(before insert, before update) {
//separate before and after
if(Trigger.isBefore) {
//separate events
if(Trigger.isInsert) {
System.debug(‘BEFORE INSERT’);
DelegateClass.performLogic(Trigger.new);
Static Flags
public with sharing class AccUpdatesControl {
// This class is used to set flag to prevent multiple calls
public static boolean calledOnce = false;
public static boolean ProdUpdateTrigger = false;
}
Chatter Triggers
trigger AddRegexTrigger on Blacklisted_Word__c (before insert, before update)
{
for (Blacklisted_Word__c f : trigger.new)
{
if(f.Custom_Expression__c != NULL)
{
f.Word__c = '';
f.Match_Whole_Words_Only__c = false;
f.RegexValue__c = f.Custom_Expression__c;
}
}
}
Hands On Tutorials
#4: Apex Triggers
#5: Apex Unit Tests
Extra Credit: http://bit.ly/ELEV-triggers
http://bit.ly/ELEVATE-Mock-Endpoint-EC
LUNCHLunch
Down the hall
Scheduled Apex
Interface for scheduling Apex jobs
Schedulable Interface
global with sharing class WarehouseUtil implements Schedulable {
//General constructor
global WarehouseUtil() {}
//Scheduled execute
global void execute(SchedulableContext ctx) {
//Use static method for checking dated invoices
WarehouseUtil.checkForDatedInvoices();
}
System.schedule('testSchedule','0 0 13 * * ?',
new WarehouseUtil());Via Apex
Via Web UI
Schedulable Interface
Batch Apex
Apex interface for processing large datasets asynchronously
Apex Batch Processing
 Governor Limits
– Various limitations around resource usage
 Asynchronous processing
– Send your job to a queue and we promise to run it
 Can be scheduled to run later
– Kind of like a cron job
Batchable Interface
global with sharing class WHUtil implements Database.Batchable<sObject>
{
global Database.QueryLocator start(Database.BatchableContext BC)
{ //Start on next context }
global void execute(Database.BatchableContext BC,
List<sObject>scope)
{ //Execute on current scope }
global void finish(Database.BatchableContext BC)
{ //Finish and clean up context }
}
Unit Testing Asynchronous Apex
//setup test data
Test.StartTest();
System.schedule('testSchedule','0 0 13 * * ?',new,WarehouseUtil());
ID batchprocessid = Database.executeBatch(new WarehouseUtil());
Test.StopTest();
//assert outcomes
Apex Integration
Using Apex with third party systems
Apex HTTP
public FlickrList getFlickrData(string tag) {
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint('http://api.flickr.com/services/feeds/photos_public.gne?
nojsoncallback=1&format=json&tags='+tag);
HTTP http = new HTTP();
HTTPResponse res = http.send(req);
return
(FlickrList)JSON.deserialize(res.getBody().replace(''',''),FlickrList.class
);
}
Apex REST
@RestResource(urlMapping='/CaseManagement/v1/*')
global with sharing class CaseMgmtService
{
@HttpPost
global static String attachPic(){
RestRequest req = RestContext.request;
RestResponse res = Restcontext.response;
Id caseId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
Blob picture = req.requestBody;
Attachment a = new Attachment (ParentId = caseId,
Body = picture,
ContentType = 'image/
Unit Tests: Mock HTTP Endpoints
@isTest
global class MockHttp implements HttpCalloutMock {
global HTTPResponse respond(HTTPRequest req) {
// Create a fake response
HttpResponse res = new HttpResponse();
res.setHeader('Content-Type', 'application/json');
res.setBody('{"foo":"bar"}');
res.setStatusCode(200);
return res;
}
}
Unit Tests: Mock HTTP Endpoints
@isTest
private class CalloutClassTest {
static void testCallout() {
Test.setMock(HttpCalloutMock.class, new MockHttp());
HttpResponse res = CalloutClass.getInfoFromExternalService();
// Verify response received contains fake values
String actualValue = res.getBody();
String expectedValue = '{"foo":"bar"}';
System.assertEquals(actualValue, expectedValue);
}
}
Hands On Tutorials
#6: Apex Batch Processing
#7: Apex REST
Extra Credit:
http://bit.ly/ELEVATE-REST-Response-EC
Visualforce
Component-based user interface framework on Salesforce1
Visualforce Components
<apex:page StandardController="Contact” extensions="duplicateUtility”
action="{!checkPhone}”>
<apex:form>
<apex:outputField var="{!Contact.FirstName}” />
<apex:outputField var="{!Contact.LastName}" />
<apex:inputField var="{!Contact.Phone}" />
<apex:commandButton value="Update" action="{!quicksave}" />
</apex:form>
</apex:page>
Standard & Custom Controllers
Custom Extensions Data bound components Controller Callbacks
Hashed information block to track server side transports
Viewstate
 Apex Forms
– Visualforce component bound to an Apex Method
 Javascript Remoting
– Annotated Apex methods exposed to JavaScript
Interacting with Apex
Using JavaScript Remoting
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.ContactExtension.makeContact}',
“003i000000cxdHP”, “Barr”
function(result, event) {
//...callback to handle result
alert(result.LastName);
});
@RemoteAction
global static Contact makeContact
(String cid, String lname) {
return new Contact(id=cid,Last_Name=lname);
}
ApexVisualforce
Sample Success Message
{
"statusCode":200,
"type":"rpc",
"ref":false,
"action":"IncidentReport",
"method":"createIncidentReport",
"result":"a072000000pt1ZLAAY",
"status":true
}
Sample Error Message
{
"statusCode":400,
"type":"exception",
"action":"IncidentReport",
"method":"createIncidentReport",
"message":"List has more than 1 row for assignment to SObject",
"data": {"0":{"Merchandise__c":"a052000000GUgYgAAL",
"Type__c":"Accident",
"Description__c":"This is an accident report"}},
"result":null,
"status":false
}
Remote Objects (Preview in Spring ’14)
<apex:jsSObjectBase shortcut="tickets">
<apex:jsSObjectModel name="Ticket__c" />
<apex:jsSObjectModel name="Contact" fields="Email" />
<script>
var contact = new tickets.Contact();
contact.retrieve({
where: {
Email: {
like: query + '%'
}
}
}, function(err, data) {
//handle query results here
CRUD/Q Functionality Data Model Components JavaScript Framework Friendly
Interacting with Apex
• ActionFunction allows direct binding of variables
• ActionFunction requires ViewState
• JavaScript Remoting binds to static methods
• JavaScript Remoting uses no ViewState
• Transient, Private and Static reduce Viewstate
Hands On Tutorials
#8: Salesforce1 Visualforce
Extra Credit:
http://bit.ly/ELEVATE-Streaming-EC
Canvas
Framework for embedding third party apps into Salesforce
How Canvas Works
• Only has to be accessible from the
user’s browser
• Authentication via OAuth or Signed
Response
• JavaScript based SDK can be
associated with any language
• Within Canvas, the App can make
API calls as the current user
• apex:CanvasApp allows
embedding via Visualforce
Any Language, Any Platform
Using publisher.js
Sfdc.canvas.publisher.subscribe({
name: "publisher.post",
onData: function(e) {
// fires when the user hits 'Submit'
postToFeed();
}
});
Sfdc.canvas.publisher.publish({
name: "publisher.close",
payload: { refresh:"true"}
});
API Leveraging industry standard HTTP
REST API
OAuth
Industry standard for authenticating users for third party apps
Remote
Application
Salesforce1
Platform
Sends App Credentials
User logs in,
Token sent to callback
Confirms token
Send access token
Maintain session with
refresh token
OAuth2 Authentication Flow
Hands On Tutorials
#9: Salesforce1 Canvas
Recess:
bit.ly/Forcecraft
Double-click to enter title
Double-click to enter text
The Wrap Up
Survey: http://bit.ly/MSP_Survey
Slides: http://bit.ly/apex_workshop_slides
Double-click to enter title
Double-click to enter text
http://developer.force.com
Developer Groups
Join a Salesforce Developer Group
http://bit.ly/fdc-dugs
Twin Cities Developer Group
http://www.meetup.com/SFTCDUG/
Become a User Group Leader
Email: April Nassi <anassi@salesforce.com>
LUNCHSalesforce1 APIs
Family of APIs on the Salesforce1 Platform
LUNCHMobile SDK
Development Kit for building hybrid and native iOS and Android apps
LUNCHAppExchange
Enterprise marketplace for Salesforce1 Apps
LUNCHHeroku
Polyglot framework for hosting applications
@forcedotcom
@joshbirk
@metadaddy
#forcedotcom
#askforce
Joshua Birk
Developer Evangelist
@joshbirk
joshua.birk@salesforce.com
Matthew Reiser
Solution Architect
@Matthew_Reiser
mreiser@salesforce.com
simplicity
is the ultimate
form of
sophistication
- Da Vinci
Thank You

Weitere ähnliche Inhalte

Was ist angesagt?

Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2Salesforce Developers
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISalesforce Developers
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforceMark Adcock
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsSalesforce Developers
 
Salesforce DX Pilot Product Overview
Salesforce DX Pilot Product OverviewSalesforce DX Pilot Product Overview
Salesforce DX Pilot Product OverviewSalesforce Partners
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce dataSalesforce Developers
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsSalesforce Developers
 
Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17Salesforce Developers
 
Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2Salesforce Developers
 
Best Practices for Lightning Apps
Best Practices for Lightning AppsBest Practices for Lightning Apps
Best Practices for Lightning AppsMark Adcock
 
Salesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep DiveSalesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep DiveSalesforce Developers
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and TestingSalesforce Developers
 
Salesforce API Series: Integrating Applications with Force.com Webinar
Salesforce API Series: Integrating Applications with Force.com WebinarSalesforce API Series: Integrating Applications with Force.com Webinar
Salesforce API Series: Integrating Applications with Force.com WebinarSalesforce Developers
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce Developers
 
Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3Mark Adcock
 
Lightning Updates: Summer, Winter & Beyond
Lightning Updates: Summer, Winter & BeyondLightning Updates: Summer, Winter & Beyond
Lightning Updates: Summer, Winter & BeyondSalesforce Developers
 

Was ist angesagt? (20)

Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2
 
Apex tutorial
Apex tutorialApex tutorial
Apex tutorial
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part I
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforce
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
Salesforce DX Pilot Product Overview
Salesforce DX Pilot Product OverviewSalesforce DX Pilot Product Overview
Salesforce DX Pilot Product Overview
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17
 
Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2
 
Best Practices for Lightning Apps
Best Practices for Lightning AppsBest Practices for Lightning Apps
Best Practices for Lightning Apps
 
Salesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep DiveSalesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep Dive
 
Building BOTS on App Cloud
Building BOTS on App CloudBuilding BOTS on App Cloud
Building BOTS on App Cloud
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
Salesforce API Series: Integrating Applications with Force.com Webinar
Salesforce API Series: Integrating Applications with Force.com WebinarSalesforce API Series: Integrating Applications with Force.com Webinar
Salesforce API Series: Integrating Applications with Force.com Webinar
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep Dive
 
SLDS and Lightning Components
SLDS and Lightning ComponentsSLDS and Lightning Components
SLDS and Lightning Components
 
Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3
 
Lightning Updates: Summer, Winter & Beyond
Lightning Updates: Summer, Winter & BeyondLightning Updates: Summer, Winter & Beyond
Lightning Updates: Summer, Winter & Beyond
 
Dreamforce Developer Recap
Dreamforce Developer RecapDreamforce Developer Recap
Dreamforce Developer Recap
 

Ähnlich wie Elevate workshop programmatic_2014

Salesforce1 Platform ELEVATE LA workshop Dec 18, 2013
Salesforce1 Platform ELEVATE LA workshop Dec 18, 2013Salesforce1 Platform ELEVATE LA workshop Dec 18, 2013
Salesforce1 Platform ELEVATE LA workshop Dec 18, 2013Salesforce Developers
 
Salesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce Developers
 
Spring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview WebinarSpring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview WebinarSalesforce Developers
 
Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)Salesforce Partners
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsRitesh Aswaney
 
Salesforce1 ELEVATE Workshop - Dublin
Salesforce1 ELEVATE Workshop - DublinSalesforce1 ELEVATE Workshop - Dublin
Salesforce1 ELEVATE Workshop - DublinJoshua Hoskins
 
Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17Mark Adcock
 
Building Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersBuilding Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersSalesforce Developers
 
Quickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudQuickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudSalesforce Developers
 
[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter Chittum[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter ChittumBeMyApp
 
Elevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance TrackElevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance TrackCarolEnLaNube
 
Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Samuel De Rycke
 
Process Automation Showdown Session 1
Process Automation Showdown Session 1Process Automation Showdown Session 1
Process Automation Showdown Session 1Michael Gill
 
Building einstein analytics apps uk-compressed
Building einstein analytics apps   uk-compressedBuilding einstein analytics apps   uk-compressed
Building einstein analytics apps uk-compressedrikkehovgaard
 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformJohn Stevenson
 

Ähnlich wie Elevate workshop programmatic_2014 (20)

Salesforce1 Platform ELEVATE LA workshop Dec 18, 2013
Salesforce1 Platform ELEVATE LA workshop Dec 18, 2013Salesforce1 Platform ELEVATE LA workshop Dec 18, 2013
Salesforce1 Platform ELEVATE LA workshop Dec 18, 2013
 
Bbva workshop
Bbva workshopBbva workshop
Bbva workshop
 
Intro to Apex Programmers
Intro to Apex ProgrammersIntro to Apex Programmers
Intro to Apex Programmers
 
Salesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce1 Platform for programmers
Salesforce1 Platform for programmers
 
Spring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview WebinarSpring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview Webinar
 
Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)
 
Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex
 
ELEVATE Paris
ELEVATE ParisELEVATE Paris
ELEVATE Paris
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction Objects
 
Salesforce1 ELEVATE Workshop - Dublin
Salesforce1 ELEVATE Workshop - DublinSalesforce1 ELEVATE Workshop - Dublin
Salesforce1 ELEVATE Workshop - Dublin
 
Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17
 
Spring '16 Release Preview Webinar
Spring '16 Release Preview Webinar Spring '16 Release Preview Webinar
Spring '16 Release Preview Webinar
 
Building Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersBuilding Visualforce Custom Events Handlers
Building Visualforce Custom Events Handlers
 
Quickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudQuickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics Cloud
 
[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter Chittum[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter Chittum
 
Elevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance TrackElevate Madrid Essentials - Advance Track
Elevate Madrid Essentials - Advance Track
 
Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015
 
Process Automation Showdown Session 1
Process Automation Showdown Session 1Process Automation Showdown Session 1
Process Automation Showdown Session 1
 
Building einstein analytics apps uk-compressed
Building einstein analytics apps   uk-compressedBuilding einstein analytics apps   uk-compressed
Building einstein analytics apps uk-compressed
 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 Platform
 

Mehr von David Scruggs

Mds cloud saturday 2015 how to heroku
Mds cloud saturday 2015 how to herokuMds cloud saturday 2015 how to heroku
Mds cloud saturday 2015 how to herokuDavid Scruggs
 
Salesforce Mobile architecture introduction
Salesforce Mobile architecture introductionSalesforce Mobile architecture introduction
Salesforce Mobile architecture introductionDavid Scruggs
 
Mobile architecture overview
Mobile architecture overviewMobile architecture overview
Mobile architecture overviewDavid Scruggs
 
Salesforce Intro to the Internet of Things
Salesforce Intro to the Internet of ThingsSalesforce Intro to the Internet of Things
Salesforce Intro to the Internet of ThingsDavid Scruggs
 
Salesforce1 for developers
Salesforce1 for developersSalesforce1 for developers
Salesforce1 for developersDavid Scruggs
 
Hca advanced developer workshop
Hca advanced developer workshopHca advanced developer workshop
Hca advanced developer workshopDavid Scruggs
 

Mehr von David Scruggs (6)

Mds cloud saturday 2015 how to heroku
Mds cloud saturday 2015 how to herokuMds cloud saturday 2015 how to heroku
Mds cloud saturday 2015 how to heroku
 
Salesforce Mobile architecture introduction
Salesforce Mobile architecture introductionSalesforce Mobile architecture introduction
Salesforce Mobile architecture introduction
 
Mobile architecture overview
Mobile architecture overviewMobile architecture overview
Mobile architecture overview
 
Salesforce Intro to the Internet of Things
Salesforce Intro to the Internet of ThingsSalesforce Intro to the Internet of Things
Salesforce Intro to the Internet of Things
 
Salesforce1 for developers
Salesforce1 for developersSalesforce1 for developers
Salesforce1 for developers
 
Hca advanced developer workshop
Hca advanced developer workshopHca advanced developer workshop
Hca advanced developer workshop
 

Kürzlich hochgeladen

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Kürzlich hochgeladen (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Elevate workshop programmatic_2014

  • 2. @forcedotcom @joshbirk @metadaddy #forcedotcom #askforce David Scruggs Principal Platform Engineer @davescruggs In/dscruggs dscruggs@salesforce.com Stewart Loewen Solution Strategist /in/stewartloewen sloewen@salesforce.com
  • 3. Safe Harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, risks associated with possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal quarter ended July 31, 2011. This document and others are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
  • 4. Login and get ready UofM Wireless Internet Instructions On Each Table
  • 6. For the Eclipse fans in the room Use the Editor of Your Choice
  • 9. Salesforce is a Platform Company. Period. -Alex Williams, TechCrunch 500M API Calls Per Day6B Lines of Apex 4M+ Apps Built on the Platform 72B Records Stored Salesforce1 Platform
  • 11. Core Services Chatter Multi- language Translation Workbench Email ServicesAnalytics Cloud Database Scheema Builder Search Visualforce MonitoringMulti-tenant Apex Data-level Security Workflows APIs Mobile Services Social APIs Analytics APIs Bulk APIsRest APIs Metadata APIs Soap APIs Private App Exchange Custom Actions Identity Mobile Notifications Tooling APIs Mobile Packs Mobile SDK Offline Support Streaming APIs Geolocation ET 1:1 ET Fuel Heroku1 Heroku Add-Ons Sharing Model ET API Salesforce1 Platform
  • 12. Every Object, Every Field: Salesforce1 Mobile Accessible AppExchange Apps: Dropbox Concur Evernote ServiceMax More Custom Apps and Integrations: SAP Oracle Everything Custom More Sales, Service and Marketing Accounts Cases Campaigns Dashboards More
  • 13. Your App Every Object, Every Field: API Enabled GET POST PATCH DELETE OAuth 2.0 HTTPS
  • 14. Every Object, Every Field: Apex and Visualforce Enabled Visualforce Pages Visualforce Components Apex Controllers Apex Triggers Custom UICustom UI Custom LogicCustom Logic
  • 15.
  • 16. Warehouse Application Requirements • Track price and inventory on hand for all merchandise • Create invoices containing one or more merchandise items as a line items • Present total invoice amount and current shipping status
  • 17. Warehouse Data Model Merchandise Name Price Inventory Pinot $20 15 Cabernet $30 10 Malbec $20 20 Zinfandel $10 50 Invoice Number Status Count Total INV-01 Shipped 16 $370 INV-02 New 20 $200 Invoice Line Items Invoice Line Merchandise Units Sold Unit Price Value INV-01 1 Pinot 1 15 $20 INV-01 2 Cabernet 5 10 $150 INV-01 3 Malbec 10 20 $200 INV-02 1 Pinot 20 50 $200
  • 18. Indexed Field • Primary Keys • Id • Name • OwnerId • Audit Dates • Created Date • Last Modified Date • Foreign Keys • Lookups • Master-Detail • CreatedBy • External ID Fields • External ID Fields • Unique Fields • Fields indexed by Salesforce Using a query with two or more indexed filters greatly increases performance
  • 19. Two Approaches to Development Visualforce Pages Visualforce Components Apex Controllers Apex Triggers Metadata API REST API Bulk API Formula Fields Validation Rules Workflows and Approvals Custom Objects Custom Fields Relationships Page Layouts Record Types User Interface Business Logic Data Model Declarative Approach Programmatic Approach
  • 20. Declarative before Programmatic Use declarative features when possible: • Quicker to build • Easier to maintain and debug • Possible addition of new features • Do not count against governor limits For example: • Will a workflow suffice instead of a trigger? • Will a custom layout work instead of Visualforce?
  • 21. Warehouse Data Model Merchandise Name Price Inventory Pinot $20 15 Cabernet $30 10 Malbec $20 20 Zinfandel $10 50 Invoice Number Status Count Total INV-01 Shipped 16 $370 INV-02 New 20 $200 Invoice Line Items Invoice Line Merchandise Units Sold Unit Price Value INV-01 1 Pinot 1 20 $20 INV-01 2 Cabernet 5 10 $150 INV-01 3 Malbec 10 20 $200 INV-02 1 Pinot 20 50 $200 Workflow Rule When inserted, if unit price is blank then fill it with the Merchandise price value
  • 22. Hands On Tutorials #1: Setup your Environment
  • 24. Introduction to Apex • Object-Oriented Language • Dot Notation Syntax • Cloud based compiling, debugging and unit testing • “First Class” Citizen on the Platform
  • 25. public with sharing class myControllerExtension implements Util { private final Account acct; public Contact newContact {get; set;} public myControllerExtension(ApexPages.StandardController stdController) { this.acct = (Account)stdController.getRecord(); } public PageReference associateNewContact(Id cid) { newContact = [SELECT Id, Account from Contact WHERE Id =: cid LIMIT 1]; newContact.Account = acct; update newContact; } } Apex Anatomy Class and Interface based Scoped Variables Inline SOQL Inline DML
  • 26. Developer Console • Browser Based IDE • Create and Edit Classes • Create and Edit Triggers • Run Unit Tests • Review Debug Logs
  • 27. Hands On Tutorials #2: Using the Dev Console #3: Creating Apex Classes Extra Credit: http://bit.ly/ELEVATE-Apex-Email-EC
  • 28. Unit Testing Code which asserts that existing logic is operating correctly
  • 29. • Code to test code • Tests can mirror user expecations • System Asserts increase predictability • Line Coverage increase predictability Unit Testing
  • 30. Unit Testing in Apex  Built in support for testing – Test Utility Class Annotation – Test Method Annotation – Test Data build up and tear down  Unit test coverage is required – Must have at least 75% of code covered  Why is it required?
  • 31. Basic Unit Test Structure @isTest public class TestClase{ @isTest static void testCase(){ //setup test data List<Contact> contacts = ContactFactory.createTestContacts(); //process / perform logic EvaluateContacts.process(contacts); //assert outcome System.assertEquals(EvaluateContacts.processed.size(),contacts.size()); } }
  • 32. Testing Permissions //Set up user User u1 = [SELECT Id FROM User WHERE Alias='auser']; //Run As U1 System.RunAs(u1){ //do stuff only u1 can do }
  • 33. Static Resource Data List<Invoice__c> invoices = Test.loadData(Invoice__c.sObjectType, 'InvoiceData'); update invoices;
  • 34. Testing Context and Asynchronous Behavior // this is where the context of your test begins Test.StartTest(); //execute future calls, batch apex, scheduled apex UtilityRESTClass.performCallout(); // this is where the context ends Text.StopTest(); System.assertEquals(a,b); //now begin assertions
  • 35. Apex Triggers • Event Based Logic • Associated with Object Types • Before or After: • Insert • Update • Delete • Undelete
  • 36. Controlling Flow trigger LineItemTrigger on Line_Item__c (before insert, before update) { //separate before and after if(Trigger.isBefore) { //separate events if(Trigger.isInsert) { System.debug(‘BEFORE INSERT’); DelegateClass.performLogic(Trigger.new);
  • 37. Static Flags public with sharing class AccUpdatesControl { // This class is used to set flag to prevent multiple calls public static boolean calledOnce = false; public static boolean ProdUpdateTrigger = false; }
  • 38. Chatter Triggers trigger AddRegexTrigger on Blacklisted_Word__c (before insert, before update) { for (Blacklisted_Word__c f : trigger.new) { if(f.Custom_Expression__c != NULL) { f.Word__c = ''; f.Match_Whole_Words_Only__c = false; f.RegexValue__c = f.Custom_Expression__c; } } }
  • 39. Hands On Tutorials #4: Apex Triggers #5: Apex Unit Tests Extra Credit: http://bit.ly/ELEV-triggers http://bit.ly/ELEVATE-Mock-Endpoint-EC
  • 41. Scheduled Apex Interface for scheduling Apex jobs
  • 42. Schedulable Interface global with sharing class WarehouseUtil implements Schedulable { //General constructor global WarehouseUtil() {} //Scheduled execute global void execute(SchedulableContext ctx) { //Use static method for checking dated invoices WarehouseUtil.checkForDatedInvoices(); }
  • 43. System.schedule('testSchedule','0 0 13 * * ?', new WarehouseUtil());Via Apex Via Web UI Schedulable Interface
  • 44. Batch Apex Apex interface for processing large datasets asynchronously
  • 45. Apex Batch Processing  Governor Limits – Various limitations around resource usage  Asynchronous processing – Send your job to a queue and we promise to run it  Can be scheduled to run later – Kind of like a cron job
  • 46. Batchable Interface global with sharing class WHUtil implements Database.Batchable<sObject> { global Database.QueryLocator start(Database.BatchableContext BC) { //Start on next context } global void execute(Database.BatchableContext BC, List<sObject>scope) { //Execute on current scope } global void finish(Database.BatchableContext BC) { //Finish and clean up context } }
  • 47. Unit Testing Asynchronous Apex //setup test data Test.StartTest(); System.schedule('testSchedule','0 0 13 * * ?',new,WarehouseUtil()); ID batchprocessid = Database.executeBatch(new WarehouseUtil()); Test.StopTest(); //assert outcomes
  • 48. Apex Integration Using Apex with third party systems
  • 49. Apex HTTP public FlickrList getFlickrData(string tag) { HttpRequest req = new HttpRequest(); req.setMethod('GET'); req.setEndpoint('http://api.flickr.com/services/feeds/photos_public.gne? nojsoncallback=1&format=json&tags='+tag); HTTP http = new HTTP(); HTTPResponse res = http.send(req); return (FlickrList)JSON.deserialize(res.getBody().replace(''',''),FlickrList.class ); }
  • 50. Apex REST @RestResource(urlMapping='/CaseManagement/v1/*') global with sharing class CaseMgmtService { @HttpPost global static String attachPic(){ RestRequest req = RestContext.request; RestResponse res = Restcontext.response; Id caseId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1); Blob picture = req.requestBody; Attachment a = new Attachment (ParentId = caseId, Body = picture, ContentType = 'image/
  • 51. Unit Tests: Mock HTTP Endpoints @isTest global class MockHttp implements HttpCalloutMock { global HTTPResponse respond(HTTPRequest req) { // Create a fake response HttpResponse res = new HttpResponse(); res.setHeader('Content-Type', 'application/json'); res.setBody('{"foo":"bar"}'); res.setStatusCode(200); return res; } }
  • 52. Unit Tests: Mock HTTP Endpoints @isTest private class CalloutClassTest { static void testCallout() { Test.setMock(HttpCalloutMock.class, new MockHttp()); HttpResponse res = CalloutClass.getInfoFromExternalService(); // Verify response received contains fake values String actualValue = res.getBody(); String expectedValue = '{"foo":"bar"}'; System.assertEquals(actualValue, expectedValue); } }
  • 53. Hands On Tutorials #6: Apex Batch Processing #7: Apex REST Extra Credit: http://bit.ly/ELEVATE-REST-Response-EC
  • 54. Visualforce Component-based user interface framework on Salesforce1
  • 55. Visualforce Components <apex:page StandardController="Contact” extensions="duplicateUtility” action="{!checkPhone}”> <apex:form> <apex:outputField var="{!Contact.FirstName}” /> <apex:outputField var="{!Contact.LastName}" /> <apex:inputField var="{!Contact.Phone}" /> <apex:commandButton value="Update" action="{!quicksave}" /> </apex:form> </apex:page> Standard & Custom Controllers Custom Extensions Data bound components Controller Callbacks
  • 56. Hashed information block to track server side transports Viewstate
  • 57.  Apex Forms – Visualforce component bound to an Apex Method  Javascript Remoting – Annotated Apex methods exposed to JavaScript Interacting with Apex
  • 58. Using JavaScript Remoting Visualforce.remoting.Manager.invokeAction( '{!$RemoteAction.ContactExtension.makeContact}', “003i000000cxdHP”, “Barr” function(result, event) { //...callback to handle result alert(result.LastName); }); @RemoteAction global static Contact makeContact (String cid, String lname) { return new Contact(id=cid,Last_Name=lname); } ApexVisualforce
  • 60. Sample Error Message { "statusCode":400, "type":"exception", "action":"IncidentReport", "method":"createIncidentReport", "message":"List has more than 1 row for assignment to SObject", "data": {"0":{"Merchandise__c":"a052000000GUgYgAAL", "Type__c":"Accident", "Description__c":"This is an accident report"}}, "result":null, "status":false }
  • 61. Remote Objects (Preview in Spring ’14) <apex:jsSObjectBase shortcut="tickets"> <apex:jsSObjectModel name="Ticket__c" /> <apex:jsSObjectModel name="Contact" fields="Email" /> <script> var contact = new tickets.Contact(); contact.retrieve({ where: { Email: { like: query + '%' } } }, function(err, data) { //handle query results here CRUD/Q Functionality Data Model Components JavaScript Framework Friendly
  • 62. Interacting with Apex • ActionFunction allows direct binding of variables • ActionFunction requires ViewState • JavaScript Remoting binds to static methods • JavaScript Remoting uses no ViewState • Transient, Private and Static reduce Viewstate
  • 63. Hands On Tutorials #8: Salesforce1 Visualforce Extra Credit: http://bit.ly/ELEVATE-Streaming-EC
  • 64. Canvas Framework for embedding third party apps into Salesforce
  • 65. How Canvas Works • Only has to be accessible from the user’s browser • Authentication via OAuth or Signed Response • JavaScript based SDK can be associated with any language • Within Canvas, the App can make API calls as the current user • apex:CanvasApp allows embedding via Visualforce Any Language, Any Platform
  • 66. Using publisher.js Sfdc.canvas.publisher.subscribe({ name: "publisher.post", onData: function(e) { // fires when the user hits 'Submit' postToFeed(); } }); Sfdc.canvas.publisher.publish({ name: "publisher.close", payload: { refresh:"true"} });
  • 67. API Leveraging industry standard HTTP REST API
  • 68. OAuth Industry standard for authenticating users for third party apps
  • 69. Remote Application Salesforce1 Platform Sends App Credentials User logs in, Token sent to callback Confirms token Send access token Maintain session with refresh token OAuth2 Authentication Flow
  • 70. Hands On Tutorials #9: Salesforce1 Canvas Recess: bit.ly/Forcecraft
  • 71. Double-click to enter title Double-click to enter text The Wrap Up
  • 73. Double-click to enter title Double-click to enter text http://developer.force.com
  • 74. Developer Groups Join a Salesforce Developer Group http://bit.ly/fdc-dugs Twin Cities Developer Group http://www.meetup.com/SFTCDUG/ Become a User Group Leader Email: April Nassi <anassi@salesforce.com>
  • 75. LUNCHSalesforce1 APIs Family of APIs on the Salesforce1 Platform
  • 76. LUNCHMobile SDK Development Kit for building hybrid and native iOS and Android apps
  • 78. LUNCHHeroku Polyglot framework for hosting applications
  • 80. Joshua Birk Developer Evangelist @joshbirk joshua.birk@salesforce.com Matthew Reiser Solution Architect @Matthew_Reiser mreiser@salesforce.com
  • 81. simplicity is the ultimate form of sophistication - Da Vinci

Hinweis der Redaktion

  1. The recommended agenda can be found here: https://docs.google.com/a/salesforce.com/spreadsheet/ccc?key=0Akr6pvkAv8X5dGFEN2ZWNUxWbS1SVFBoRS1oZU5kQWc&amp;usp=drive_web#gid=22 Under the “Workshop: S1 Programmer” tab Errors, comments, suggestions in either the deck or the workbook can be mentioned on Josh Birk’s Chatter feed, or written up in Google Docs and shared with Josh Birk and Mario Korf. There is a demo org for the Warehouse ELEVATE here: https://login.salesforce.com/?un=elevate@demo.com&amp;pw=demo1234 It has: Enhanced Data Model The workflows, etc from the Basic class The Apex and VF from the Programmers class Canvas definitions from the Programmers class - including the Create_Delivery Invoice action FlickrView (also known as PuppyForce) Chatter Blacklist BEFORE YOU PRESENT – go through the slides and update: YOUR NAME(S) TWITTER/EMAIL LUNCH INFO BITLY SURVEY LINK DUG INFORMATION As these are just placeholders in the slides right now. THESE SPEAKER NOTES ARE NOT VERBATIM. They are there just as hints as to what to cover.
  2. Introduce the day. Poll the audience for level of experience. You’ll want to know who is a Java dev and who is a new or experienced to our platform.
  3. Introduce Yourselves Note: this is a slide if there is more than one presenter
  4. Introduce Yourselves Note: this is a slide if there is only one presenter
  5. Introduce Yourselves Note: this is a slide if there is more than one presenter
  6. Safe Harbor
  7. Change this slide to match the local internet requirements.
  8. Highlight that this is not just a day of talking to them, this is a dialogue and they should ask questions as they like – even ones that don’t pertain to the current “section”. Projects they’re working on, features they have heard about, etc.
  9. Since there may be experienced devs, invite the to use the IDE of their choice (Sublime, Eclipse) even if the tutorials point to Dev Console
  10. They should create a brand new DE org if they have not done so recently. They should not use a Trial, Sandbox or Production org. Emphasize our DE orgs are free and do not expire (they are not product trials)
  11. THIS IS THE ONLINE VERSION OF THE NEW WORKBOOK DRAFT
  12. Salesforce is often thought of as a CRM company, but these stats show we have platform services in use as well
  13. 1.4 million includes Force.com, Heroku and ExactTarget
  14. Our platform is not merely a cloud hosting service, it is a series of tools and features that enable developers to be successful.
  15. On our platform, as you building your data model – you are getting a lot more than just a relational database. You get a mobile app, right out of the gate.
  16. You get our API’s, automatically extended: REST, SOAP, Bulk, Streaming
  17. And our programmatic features are automatically aware of the data model as well.
  18. Now some of you might have worked with out Warehouse demo application before. If you haven’t here’s a quick recap.
  19. These are the core business requirements of the Warehouse application
  20. Here is an overview of what our data model will look like. POTENTIAL DEMO: View this in Schema Builder
  21. This is our first “pro tip” slide. Using these kinds of fields can increase SOQL searches.
  22. Our Basics workshop covers the declarative side of our platform, but let’s do a quick review.
  23. Here is an overview of what our data model will look like. POTENTIAL DEMO: View this in Schema Builder
  24. OK, this is a quick break to make sure everyone is up and running. The workbook walks through installing the warehouse model, creating some test data and basically making sure your DE org is setup correctly. Let’s take a chance to do that.
  25. For when declarative logic is not enough, we provide Apex. Apex is a cloud-based programming language, very similar to Java – except that you can code, compile and deploy all right from your Salesforce instance. You’ll see how we can create robust programmatic functions right from your browser.
  26. If you are familiar with Java or C#, you are going to be familiar with Apex. It is OO and uses dot notation. However, Apex is completely cloud based – you can compile and debug right in your browser. Because it runs right in your instance it is also a “first class” citizen – meaning we can do actions right within Apex without any additional configuration or libraries.
  27. Let’s take a look at an example Apex class
  28. That’s what Apex is – how do we code it? It is possible to use a third party IDE like Sublime or Eclipse – but you can also code right in your browser. Our Developer Console allows you to create and edit code, debug your applications and run unit tests. POTENTIAL DEMO: Show Anonymous Apex in the Dev Console
  29. This will be a quick review for the Force.com devs in the room.
  30. That is a picture of the first ever bug. Yes, it was a real bug. To keep bugs from happening, we use unit testing.
  31. Basic overview of how Unit Testing works POTENTIAL DEMO: Walk through TestInvoiceStatementDeletion on the demo org and run the test
  32. Basic overview of how Unit Testing works POTENTIAL DEMO: Walk through TestInvoiceStatementDeletion on the demo org and run the test
  33. Pro tip: You may want to have a unit test follow a scenario based on a specific profile. It’s pretty easy to do.
  34. Pro tip: You may want to have a unit test follow a scenario based on a specific profile. It’s pretty easy to do.
  35. Pro tip: You can also load your test data off a static resource, it is easier to handle large data sets and and test data can be swapped out easily.
  36. Pro tip: You can also load your test data off a static resource, it is easier to handle large data sets and and test data can be swapped out easily.
  37. Overview of Apex Triggers
  38. Pro tip: Best to use on trigger per logic, and then you can control the flow of the logic with the system levelTrigger variable
  39. Pro tip: Triggers retain scope during an execution, so if want to keep them from being hit again and again (based on other updates/workflows) you can use a static flag on the trigger to turn it “off”
  40. Pro tip: We can use Triggers on Chatter. In fact: Potential Demo: Chatter Blacklist
  41. OK, now we have two tutorials. The first is building a simple trigger on the plaform and then there is a walkthrough of a unit test. For the vets in the room, we’ve got a little extra credit challenge. This is in the form of a gist online, but it walks you through a more advanced version of a trigger.
  42. Update this slide with specifics about lunch
  43. Scheduled Apex allows us to run business logic in the background at specific intervals
  44. It uses the Schedulable interface, which allows us define the execute method to control what logic will be run on the schedule
  45. You can define the schedule in two ways
  46. We also have Batch Apex, which is a close cousin to Scheduled Apex
  47. Batch apex allows us to queue up data and have logic run against it asynchronously.
  48. The interface itself allows us to introduce logic when a queue of objects is being run. POTENTIAL DEMO: CleanUpRecords
  49. PRO Tip: Remember when we talked about controlling context with Start and Stop test? This is also works for batch processing.
  50. At the beginning we talked about how your data model is automatically extended with our API’s. So out of the box, no programming, you get REST and SOAP endpoints to query and manipulate data. Basic CRUD stuff. You also get our Bulk and Streaming API for free – but we don’t have time to cover those here. You can also expose custom logic via endpoints using Apex.
  51. We are going to focus on Apex REST today. This is how you setup an Apex REST class. The RestResource annotation defines the actual endpoint. Methods are then assigned an HTTP method. So when we hit the CaseManagement endpoint here, and we send it an HTTP Post request … it will hit the attachPic method. Potential DEMO: Workbench operating against MerchandiseManager class
  52. Pro Tip: In your unit test, you can fake a third party endpoint. You generate a class that will a mock a return.
  53. Then you sub that endpoint for what the real code will hit when it attempts to call out.
  54. OK, two more tutorials – the first on Batch processing and then another on Apex REST.
  55. Visualforce is the user interface sibling to Apex. It also runs in the cloud, in your instance – and it allows you to create brand new experiences for your customers and users.
  56. What do we mean by components? Well you’d start with a page component, and that will define how the whole page is going to be rendered. And then you can add things like a form and fields for the form. Now everything you see here will be HTML when it gets outputted. So you’d have and HTML form, HTML input tags, etc. To the browser, it is just standard HTML. But how are we binding data here? We define a controller, which gets access to server-side logic. Whenever you see these brackets and that exclamation point, you’re looking at dynamically bound data which will effect how the component is rendered. However, the server-side logic here is a little interesting. POTENTIAL DEMO: Do Standard Controller demo, then go back to describe custom controllers and extensions.
  57. However what we just saw there is using a viewstate. If you aren’t familiar with a viewstate, it’s a block of hashed information on the client which tracks changes – allowing us to get around the fact that HTTP is stateless.
  58. We have options, though. While a lot of Visualforce relies on bound forms to transmit data (and a viewstate), we can also talk directly to Apex via JavaScript and avoid the viewstate. This is more JavaScript friendly and also has a small footprint.
  59. We have options, though. While a lot of Visualforce relies on bound forms to transmit data (and a viewstate), we can also talk directly to Apex via JavaScript and avoid the viewstate. This is more JavaScript friendly and also has a small footprint. DEMO: JS Remoting. You could preview FindNearby, or you could do a quick example on the fly.
  60. The data is going to come back to us in JSON. Note that result here might be a string, or JSON representation of an array or object.
  61. Or we’ll see an error DEMO: JS Remoting
  62. In Spring ’14 we are rolling out a preview of a new feature called Remote Objects. It lets us perform CRUD functionality without having to write an Apex class, kind of like a Standard Controller.
  63. So a quick overview.
  64. Now we have a tutorial on writing a Visualforce page. This page is designed to run in Salesforce1, and uses JavaScript Remoting to locate nearby warehouses.
  65. Let’s talk about another kind of user interface. This is one you might already have built out, running on your own network. How can we best integrate that back into Salesforce?
  66. Canvas makes that easy. With a connected app defined, Canvas handles the authentication of the current user against the third party UI. The external application can be anything the user would normally be able to see in their browser. It can then make API calls on the user’s behalf.
  67. We have API’s to fit a wide range of use cases. Our REST API is very versatile, and one of the main use cases is mobile applications – and Canvas relies on the REST API to make calls back into Salesforce.
  68. Before we can make a callout though, we need to authenticate right? Canvas makes this easy, and it uses two methods – but both are similar and based on the flow of OAuth. OAuth is used by Google, Facebook, Twitter, pretty much everyone on the planet to securely authenticate first party credentials with third party apps.
  69. Let’s walk through the flow of OAuth. Demo: A great one here could be Forcecraft
  70. OK, this tutorial walks us through two different applications using Canvas.
  71. Update this slide with local DUG information
  72. THESE SLIDES ARE OPTIONAL DEPENDING ON TIME For instance, we talked about how your data model automatically extends what VF and Apex can do – but what about our API’s? We have several.
  73. THESE SLIDES ARE OPTIONAL DEPENDING ON TIME Salesforce1 Mobile is one of our offerings, but you can also create your own custom applications. POTENTIAL DEMO: Quick Start on forceios / forcedroid
  74. THIS SLIDE MAY ALSO HAVE BEEN COVERED BY AN ISV SPEAKER THESE SLIDES ARE OPTIONAL DEPENDING ON TIME We also have an entire marketplace for finding, buying and selling apps. NOTE: Chatter Blacklist as a Labs App (Free and Unmanaged)
  75. THESE SLIDES ARE OPTIONAL DEPENDING ON TIME Heroku provides a framework for easily deploying the applications in the language of your choice. POTENTIAL DEMO: Quick PHP deployment.
  76. Introduce Yourselves Note: this is a slide if there is more than one presenter
  77. Introduce Yourselves Note: this is a slide if there is more than one presenter
  78. statue