SlideShare a Scribd company logo
1 of 71
HCA Advanced Developer
Workshop
David Scruggs
Platform Architect
dscruggs@salesforce.com
770-837-0241
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.
Agenda
 Introduction to the Salesforce1 Platform

 Salesforce1 + Visualforce
 Salesforce1 + Canvas
 Apex + APIs
 Wrap-Up
Introduction to the
Salesforce1 Platform
Salesforce1 Platform

6B

Lines of Apex

500M
API Calls
Per Day

4M+

Apps Built on
the Platform

72B
Records
Stored

Salesforce is a Platform Company. Period.
-Alex Williams, TechCrunch
Salesforce1 Platform
APIs

REST APIs

Bulk
APIs

Tooling
APIs

Metadata
APIs

Analytics
APIs

Social
APIs

ET API

Streaming
APIs

Mobile
SDK

Mobile
Packs

Offline
Support

Geolocation

Custom
Actions

Identity

Private App
Exchange

Mobile
Notifications

Visualforce
1

Chatter

Mobile
Services

SOAP
APIs

Workflows

Analytics

Apex

Multilanguage

Heroku
Add-Ons

Email
Service
s

ET 1:1

ET Fuel

Multi-tenant

Cloud
Database

Data-level
Security

Schema
Builder

Sharing
Model

Translation
Workbench

Search

Heroku1

Monitoring

Core Services
Program Materials
http://developer.force.com/join

Free Developer
Environment
Program Materials
Workbook
http://bit.ly/dfc_adv_workbook

Slides
http://www.slideshare.net/da
vescruggs/hca-advanceddeveloper-workshop
Warehouse Data Model
Invoice
Number

Status

Count

Total

INV-01

Shipped

16

$370

INV-02

New

20

$400

Merchandise

Invoice Line Items
Line

Merchandise

Units
Sold

Value

INV-01

1

Pinot

1

$20

INV-01

2

Cabernet

5

$150

INV-01

3

Malbec

10

$200

INV-02

1

Pinot

20

$400

Install in your org: bit.ly/1hFwqaDI

Name

Price

Inventory

Pinot

Invoice

$20

15

Cabernet

$30

10

Malbec

$20

20
APEX
Apex
Cloud based programming language
Apex Anatomy

 Class and Interface based
 Scoped Variables

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;
Inline SOQL
}
}


 Inline DML
Salesforce1 + Visualforce
Visualforce Anatomy

Controllers
 StandardControllers
Custom
Custom Extensions

<apex:page StandardController="Contact"
extensions="duplicateUtility"
action="{!checkPhone}">
<apex:form>

 Data bound components

 Controller Callbacks

<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>
}

JavaScript Remoting
@RemoteAction
public static String updateMerchandiseItem(String productId, Integer newInventory) {
List<Merchandise__c> m = [SELECT Id, Total_Inventory__c from Merchandise__c
WHERE Id =: productId LIMIT 1];
if (m.size() > 0) {
m[0].Total_Inventory__c = newInventory;
try {
update m[0];
return 'Item Updated';
} catch (Exception e) {
return e.getMessage();
$(".updateBtn").click(function() {
}
var id = j$(this).attr('data-id');
}
var inventory = parseInt(j$("#inventory"+id).val());
else {
$.mobile.showPageLoadingMsg();
return 'No item found with that ID';
}
MobileInventoryExtension.updateMerchandiseItem(id, inventory,handleUpdate);
}
});

 Access Apex from JavaScript
 Asynchronous Responses

Apex
JavaScript
in
Visualforce
Custom Components
<apex:component controller="GeoComponentController">
<apex:attribute name="lat"
type="Decimal"
description="Latitude for geolocation query"
assignTo="{!lat}” />
<apex:attribute name="lon"
type="Decimal"
description="Longitude for geolocation query"
assignTo="{!lon}” />

<c:GeoComponent lat=”8.9991" lon=”10.0019" />
Page Templates
<apex:page >
<apex:insert name="detail" />
<div style="position:relative; clear:all;">
<apex:insert name="footer" />
</div>
</apex:page>

<apex:page StandardController="Invoice__c" >
<apex:composition template="WarehouseTemplate">
<apex:define name="detail">
<apex:detail subject="{!Invoice__c.Id}" />
</apex:define>
Chatter Components

<chatter:follow/>
<chatter:newsfeed/>
<chatter:feed/>

<chatter:followers/>
<chatter:feedAndFollowers/>
Common Use Cases

Email Templates

Embed in Page Layouts

Mobile Interfaces

Generate PDFs

Page Overrides
Visualforce Controllers
Apex for constructing dynamic pages
Viewstate
Hashed information block to track server side transports
Reducing Viewstate
//Transient data that does not get sent back,
//reduces viewstate
transient String userName {get; set;}
//Static and/or private vars
//also do not become part of the viewstate
static private integer VERSION_NUMBER = 1;
Reducing Viewstate
//Asynchronous JavaScript callback. No viewstate.
//RemoteAction is static, so has no access to Controller context
@RemoteAction
public static Account retrieveAccount(ID accountId) {
try {
Account a = [SELECT ID, Name from ACCOUNT
WHERE Id =:accountID LIMIT 1];
return a;
} catch (DMLException e) {
return null;
}
}
Handling Parameters
//check the existence of the query parameter
if(ApexPages.currentPage().getParameters().containsKey(„id‟)) {
try {
Id aid = ApexPages.currentPage().getParameters().get(„id‟);
Account a =
[SELECT Id, Name, BillingStreet FROM Account
WHERE ID =: aid];
} catch(QueryException ex) {
ApexPages.addMessage(new ApexPages.Message(
ApexPages.Severity.FATAL, ex.getMessage()));
return;
}
}
SOQL Injection
String account_name = ApexPages.currentPage().getParameters().get('name');

account_name = String.escapeSingleQuotes(account_name);
List<Account> accounts = Database.query('SELECT ID FROM
Account WHERE Name = '+account_name);
Cookies
//Cookie =
//new Cookie(String name, String value, String path,
//
Integer milliseconds, Boolean isHTTPSOnly)
public PageReference setCookies() {
Cookie companyName =
new Cookie('accountName','TestCo',null,315569260,false);
ApexPages.currentPage().setCookies(new Cookie[]{companyName});
return null;
}
public String getCookieValue() {
return ApexPages.currentPage().
getCookies().get('accountName').getValue();
}
Inheritance and Construction
public with sharing class PageController
implements SiteController {

public PageController() {
}

public PageController(ApexPages.StandardController stc) {
}
Controlling Redirect
//Stay on same page
return null;

//New page, no Viewstate
PageReference newPage = new Page.NewPage();
newPage.setRedirect(true);
return newPage;

//New page, retain Viewstate
PageReference newPage = new Page.NewPage();
newPage.setRedirect(false);
return newPage;
Unit Testing Pages
//Set test page
Test.setCurrentPage(Page.VisualforcePage);
//Set test data
Account a = new Account(Name='TestCo');
insert a;
//Set test params
ApexPages.currentPage().getParameters().put('id',a.Id);
//Instatiate Controller
SomeController controller = new SomeController();

//Make assertion
System.assertEquals(controller.AccountId,a.Id)
Visualforce Components
Embedding content across User Interfaces
Visualforce Dashboards

Custom Controller

Dashboard Widget

<apex:page controller="retrieveCase"
tabStyle="Case">
<apex:pageBlock>
{!contactName}s Cases
<apex:pageBlockTable value="{!cases}"
var="c">
<apex:column value="{!c.status}"/>
<apex:column value="{!c.subject}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Page Overrides

Select Override

Define Override
Templates

Layout inserts

Define with
Composition

<apex:page controller="compositionExample">
<apex:form >
<apex:insert name=”header" />
<br />
<apex:insert name=“body" />

<apex:composition template="myFormComposition
<apex:define name=”header">
<apex:outputLabel value="Enter your favorite m
<apex:inputText id=”title" value="{!mealField}"
</apex:define>
<h2>Page Content</h2>
Custom Components

Define Attributes

<apex:component controller="WarehouseAccounts
<apex:attribute name="lat" type="Decimal" descrip
Query" assignTo="{!lat}"/>
<apex:attribute name="long" type="Decimal" desc
Geolocation Query" assignTo="{!lng}"/>
<apex:pageBlock >

public with sharing class WarehouseAccountsCont

Assign to Apex

public Decimal lat {get; set;}
public Decimal lng {get; set;}
private List<Account> accounts;
public WarehouseAccountsController() {}
Page Embeds

Standard Controller

Embed in Layout

<apex:page StandardController=”Account”
showHeader=“false”
<apex:canvasApp
developerName=“warehouseDev”
applicationName=“procure”
Extending Salesforce1 with Visualforce Pages

bit.ly/1f7feZN

Time: 60 Minutes
Salesforce1 + Canvas
Canvas
Framework for using third party apps within Salesforce
Canvas Anatomy

Any Language, Any Platform

•
•
•
•
•

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
Integrating Your Web Applications in Salesforce1 with
Force.com Canvas

http://bit.ly/1n8C4WK

Time: 45 Minutes
Apex + APIs
“Universal Connectors”

http://makezine.com/2012/03/19/universal-adapter-set-for-construction-toys/
Apex Triggers
Event based programmatic logic
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);
//
Delegates
public class BlacklistFilterDelegate
{
public static Integer FEED_POST = 1;
public static Integer FEED_COMMENT = 2;
public static Integer USER_STATUS = 3;
List<PatternHelper> patterns {set; get;}
Map<Id, PatternHelper> matchedPosts {set; get;}
public BlacklistFilterDelegate()
{
patterns = new List<PatternHelper>();
matchedPosts = new Map<Id, PatternHelper>();
preparePatterns();
}
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;
}
else
f.RegexValue__c = RegexHelper.toRegex(f.Word__c,
f.Match_Whole_Words_Only__c);
}
}
Scheduled Apex
Cron-like functionality to schedule Apex tasks
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();
}
Schedulable Interface

Via Apex

Via Web UI

System.schedule('testSchedule','0 0 13 * * ?',
new WarehouseUtil());
Batch Apex
Functionality for Apex to run continuously in the background
Batchable Interface
global with sharing class WarehouseUtil
implements Database.Batchable<sObject> {
//Batch execute interface
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
Test.StartTest();
System.schedule('testSchedule','0 0 13 * * ?',new,WarehouseUtil());
ID batchprocessid = Database.executeBatch(new WarehouseUtil());
Test.StopTest();
OAuth
Industry standard method of user authentication
OAuth2 Flow

Sends App Credentials
User logs in,
Token sent to callback

Remote
Application

Confirms token

Send access token

Maintain session with
refresh token

Salesforce
Platform
Apex Endpoints
Exposing Apex methods via SOAP and REST
Apex SOAP
global class MyWebService {
webService static Id makeContact(String lastName, Account a) {
Contact c = new Contact(lastName = 'Weissman',
AccountId = a.Id);
insert c;
return c.id;
}
}
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/
Apex Email
Classes to handle both incoming and outgoing email
Outgoing Email
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String body = count+' closed records older than 90 days have been deleted';
//Set addresses based on label
mail.setToAddresses(Label.emaillist.split(','));
mail.setSubject ('[Warehouse] Dated Invoices');
mail.setPlainTextBody(body);
//Send the email
Messaging.SendEmailResult [] r =
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
Incoming Email
global class PageHitsController implements Messaging.InboundEmailHandler {
global Messaging.InboundEmailResult handleInboundEmail(
Messaging.inboundEmail email,
Messaging.InboundEnvelope env)
{
if(email.textAttachments.size() > 0) {
Messaging.InboundEmail.TextAttachment csvDoc =
email.textAttachments[0];
PageHitsController.uploadCSVData(csvDoc.body);
}
Messaging.InboundEmailResult result = new
Messaging.InboundEmailResult();
result.success = true;
return result;
}
Incoming Email

Define Service

Limit Accepts
Team Development
Tools for teams and build masters
Metadata API
API to access customizations to the Force.com platform
Migration Tool
Ant based tool for deploying Force.com applications
Continuous Integration
Development

Testing
Source
Control

DE

CI Tool

Sandbox
Fail
Notifications
Tooling API
Access, create and edit Force.com application code
Tutorial 472 – Create an App
http://bit.ly/dfc_adv_workbook
Time: 30 Minutes
Note: use bit.ly/1b1Runu as the Gist.
Double-click to enter title

The Wrap Up
Double-click to enter text

More Related Content

What's hot

Build your API with Force.com and Heroku
Build your API with Force.com and HerokuBuild your API with Force.com and Heroku
Build your API with Force.com and HerokuJeff Douglas
 
The SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.js
The SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.jsThe SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.js
The SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.jsShashank Srivatsavaya (ShashForce)
 
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
 
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, AnywhereData Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, AnywhereSalesforce Developers
 
Atl elevate programmatic developer slides
Atl elevate programmatic developer slidesAtl elevate programmatic developer slides
Atl elevate programmatic developer slidesDavid Scruggs
 
Build, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
Build, Manage, and Deploy Mobile Apps Faster with App Cloud MobileBuild, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
Build, Manage, and Deploy Mobile Apps Faster with App Cloud MobileSalesforce Developers
 
Lightning Component - Components, Actions and Events
Lightning Component - Components, Actions and EventsLightning Component - Components, Actions and Events
Lightning Component - Components, Actions and EventsDurgesh Dhoot
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce IntegrationJoshua Hoskins
 
Easy REST Integrations with Lightning Components and Salesforce1
Easy REST Integrations with Lightning Components and Salesforce1Easy REST Integrations with Lightning Components and Salesforce1
Easy REST Integrations with Lightning Components and Salesforce1Salesforce Developers
 
Two-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsTwo-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsSalesforce Developers
 
sf tools from community
sf tools from communitysf tools from community
sf tools from communityDurgesh Dhoot
 
Modeling and Querying Data and Relationships in Salesforce
Modeling and Querying Data and Relationships in SalesforceModeling and Querying Data and Relationships in Salesforce
Modeling and Querying Data and Relationships in SalesforceSalesforce Developers
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base ComponentsSalesforce Developers
 
Intro to the Salesforce Mobile SDK: Building Android Apps
Intro to the Salesforce Mobile SDK: Building Android AppsIntro to the Salesforce Mobile SDK: Building Android Apps
Intro to the Salesforce Mobile SDK: Building Android AppsSalesforce Developers
 
Access External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning ConnectAccess External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning ConnectSalesforce Developers
 
Lightning components performance best practices
Lightning components performance best practicesLightning components performance best practices
Lightning components performance best practicesSalesforce 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
 

What's hot (20)

Building BOTS on App Cloud
Building BOTS on App CloudBuilding BOTS on App Cloud
Building BOTS on App Cloud
 
Build your API with Force.com and Heroku
Build your API with Force.com and HerokuBuild your API with Force.com and Heroku
Build your API with Force.com and Heroku
 
The SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.js
The SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.jsThe SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.js
The SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.js
 
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
 
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, AnywhereData Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
 
Atl elevate programmatic developer slides
Atl elevate programmatic developer slidesAtl elevate programmatic developer slides
Atl elevate programmatic developer slides
 
Build, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
Build, Manage, and Deploy Mobile Apps Faster with App Cloud MobileBuild, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
Build, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
 
Lightning Component - Components, Actions and Events
Lightning Component - Components, Actions and EventsLightning Component - Components, Actions and Events
Lightning Component - Components, Actions and Events
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
Easy REST Integrations with Lightning Components and Salesforce1
Easy REST Integrations with Lightning Components and Salesforce1Easy REST Integrations with Lightning Components and Salesforce1
Easy REST Integrations with Lightning Components and Salesforce1
 
Two-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsTwo-Way Integration with Writable External Objects
Two-Way Integration with Writable External Objects
 
sf tools from community
sf tools from communitysf tools from community
sf tools from community
 
Exploring the Salesforce REST API
Exploring the Salesforce REST APIExploring the Salesforce REST API
Exploring the Salesforce REST API
 
Modeling and Querying Data and Relationships in Salesforce
Modeling and Querying Data and Relationships in SalesforceModeling and Querying Data and Relationships in Salesforce
Modeling and Querying Data and Relationships in Salesforce
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
Intro to the Salesforce Mobile SDK: Building Android Apps
Intro to the Salesforce Mobile SDK: Building Android AppsIntro to the Salesforce Mobile SDK: Building Android Apps
Intro to the Salesforce Mobile SDK: Building Android Apps
 
Access External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning ConnectAccess External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning Connect
 
Lightning components performance best practices
Lightning components performance best practicesLightning components performance best practices
Lightning components performance best practices
 
Introduction to Apex for Developers
Introduction to Apex for DevelopersIntroduction to Apex for Developers
Introduction to Apex for 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 '17
 

Similar to Hca advanced developer workshop

[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
 
Tour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsTour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsSalesforce Developers
 
How We Built AppExchange and our Communities on the App Cloud (Platform)
How We Built AppExchange and our Communities on the App Cloud (Platform)How We Built AppExchange and our Communities on the App Cloud (Platform)
How We Built AppExchange and our Communities on the App Cloud (Platform)Dreamforce
 
Boxcars and Cabooses: When One More XHR Is Too Much
Boxcars and Cabooses: When One More XHR Is Too MuchBoxcars and Cabooses: When One More XHR Is Too Much
Boxcars and Cabooses: When One More XHR Is Too MuchPeter Chittum
 
Salesforce Campus Tour - Developer Advanced
Salesforce Campus Tour - Developer AdvancedSalesforce Campus Tour - Developer Advanced
Salesforce Campus Tour - Developer AdvancedJames Ward
 
Developer Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 PlatformDeveloper Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 PlatformSalesforce Deutschland
 
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
 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformJohn Stevenson
 
Forcelandia 2016 Wave App Development
Forcelandia 2016   Wave App DevelopmentForcelandia 2016   Wave App Development
Forcelandia 2016 Wave App DevelopmentSkip Sauls
 
Unlock SAP - Release the potential of your existing backend systems with Sale...
Unlock SAP - Release the potential of your existing backend systems with Sale...Unlock SAP - Release the potential of your existing backend systems with Sale...
Unlock SAP - Release the potential of your existing backend systems with Sale...Salesforce Deutschland
 
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStoreDeveloping Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStoreTom Gersic
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsRitesh Aswaney
 
Building Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersBuilding Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersSalesforce Developers
 
CloudOps evening presentation from Salesforce.com
CloudOps evening presentation from Salesforce.comCloudOps evening presentation from Salesforce.com
CloudOps evening presentation from Salesforce.comAlistair Croll
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platformJohn Stevenson
 
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStoreDeveloping Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStoreSalesforce Developers
 
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
 
Force.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comForce.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comSalesforce Developers
 

Similar to Hca advanced developer workshop (20)

[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
 
Salesforce platform session 2
 Salesforce platform session 2 Salesforce platform session 2
Salesforce platform session 2
 
Tour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsTour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration Methods
 
How We Built AppExchange and our Communities on the App Cloud (Platform)
How We Built AppExchange and our Communities on the App Cloud (Platform)How We Built AppExchange and our Communities on the App Cloud (Platform)
How We Built AppExchange and our Communities on the App Cloud (Platform)
 
Streaming API with Java
Streaming API with JavaStreaming API with Java
Streaming API with Java
 
Boxcars and Cabooses: When One More XHR Is Too Much
Boxcars and Cabooses: When One More XHR Is Too MuchBoxcars and Cabooses: When One More XHR Is Too Much
Boxcars and Cabooses: When One More XHR Is Too Much
 
Salesforce Campus Tour - Developer Advanced
Salesforce Campus Tour - Developer AdvancedSalesforce Campus Tour - Developer Advanced
Salesforce Campus Tour - Developer Advanced
 
Developer Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 PlatformDeveloper Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 Platform
 
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
 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 Platform
 
Forcelandia 2016 Wave App Development
Forcelandia 2016   Wave App DevelopmentForcelandia 2016   Wave App Development
Forcelandia 2016 Wave App Development
 
Unlock SAP - Release the potential of your existing backend systems with Sale...
Unlock SAP - Release the potential of your existing backend systems with Sale...Unlock SAP - Release the potential of your existing backend systems with Sale...
Unlock SAP - Release the potential of your existing backend systems with Sale...
 
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStoreDeveloping Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction Objects
 
Building Visualforce Custom Events Handlers
Building Visualforce Custom Events HandlersBuilding Visualforce Custom Events Handlers
Building Visualforce Custom Events Handlers
 
CloudOps evening presentation from Salesforce.com
CloudOps evening presentation from Salesforce.comCloudOps evening presentation from Salesforce.com
CloudOps evening presentation from Salesforce.com
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platform
 
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStoreDeveloping Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
 
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
 
Force.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comForce.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.com
 

More from 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
 

More from 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
 
Bbva workshop
Bbva workshopBbva workshop
Bbva workshop
 
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
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

Hca advanced developer workshop

  • 1. HCA Advanced Developer Workshop David Scruggs Platform Architect dscruggs@salesforce.com 770-837-0241
  • 2. 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.
  • 3. Agenda  Introduction to the Salesforce1 Platform  Salesforce1 + Visualforce  Salesforce1 + Canvas  Apex + APIs  Wrap-Up
  • 5. Salesforce1 Platform 6B Lines of Apex 500M API Calls Per Day 4M+ Apps Built on the Platform 72B Records Stored Salesforce is a Platform Company. Period. -Alex Williams, TechCrunch
  • 6. Salesforce1 Platform APIs REST APIs Bulk APIs Tooling APIs Metadata APIs Analytics APIs Social APIs ET API Streaming APIs Mobile SDK Mobile Packs Offline Support Geolocation Custom Actions Identity Private App Exchange Mobile Notifications Visualforce 1 Chatter Mobile Services SOAP APIs Workflows Analytics Apex Multilanguage Heroku Add-Ons Email Service s ET 1:1 ET Fuel Multi-tenant Cloud Database Data-level Security Schema Builder Sharing Model Translation Workbench Search Heroku1 Monitoring Core Services
  • 10. Warehouse Data Model Invoice Number Status Count Total INV-01 Shipped 16 $370 INV-02 New 20 $400 Merchandise Invoice Line Items Line Merchandise Units Sold Value INV-01 1 Pinot 1 $20 INV-01 2 Cabernet 5 $150 INV-01 3 Malbec 10 $200 INV-02 1 Pinot 20 $400 Install in your org: bit.ly/1hFwqaDI Name Price Inventory Pinot Invoice $20 15 Cabernet $30 10 Malbec $20 20
  • 11. APEX
  • 13. Apex Anatomy  Class and Interface based  Scoped Variables 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; Inline SOQL } }   Inline DML
  • 15. Visualforce Anatomy Controllers  StandardControllers Custom Custom Extensions <apex:page StandardController="Contact" extensions="duplicateUtility" action="{!checkPhone}"> <apex:form>  Data bound components  Controller Callbacks <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>
  • 16. } JavaScript Remoting @RemoteAction public static String updateMerchandiseItem(String productId, Integer newInventory) { List<Merchandise__c> m = [SELECT Id, Total_Inventory__c from Merchandise__c WHERE Id =: productId LIMIT 1]; if (m.size() > 0) { m[0].Total_Inventory__c = newInventory; try { update m[0]; return 'Item Updated'; } catch (Exception e) { return e.getMessage(); $(".updateBtn").click(function() { } var id = j$(this).attr('data-id'); } var inventory = parseInt(j$("#inventory"+id).val()); else { $.mobile.showPageLoadingMsg(); return 'No item found with that ID'; } MobileInventoryExtension.updateMerchandiseItem(id, inventory,handleUpdate); } });  Access Apex from JavaScript  Asynchronous Responses Apex JavaScript in Visualforce
  • 17. Custom Components <apex:component controller="GeoComponentController"> <apex:attribute name="lat" type="Decimal" description="Latitude for geolocation query" assignTo="{!lat}” /> <apex:attribute name="lon" type="Decimal" description="Longitude for geolocation query" assignTo="{!lon}” /> <c:GeoComponent lat=”8.9991" lon=”10.0019" />
  • 18. Page Templates <apex:page > <apex:insert name="detail" /> <div style="position:relative; clear:all;"> <apex:insert name="footer" /> </div> </apex:page> <apex:page StandardController="Invoice__c" > <apex:composition template="WarehouseTemplate"> <apex:define name="detail"> <apex:detail subject="{!Invoice__c.Id}" /> </apex:define>
  • 20. Common Use Cases Email Templates Embed in Page Layouts Mobile Interfaces Generate PDFs Page Overrides
  • 21. Visualforce Controllers Apex for constructing dynamic pages
  • 22. Viewstate Hashed information block to track server side transports
  • 23. Reducing Viewstate //Transient data that does not get sent back, //reduces viewstate transient String userName {get; set;} //Static and/or private vars //also do not become part of the viewstate static private integer VERSION_NUMBER = 1;
  • 24. Reducing Viewstate //Asynchronous JavaScript callback. No viewstate. //RemoteAction is static, so has no access to Controller context @RemoteAction public static Account retrieveAccount(ID accountId) { try { Account a = [SELECT ID, Name from ACCOUNT WHERE Id =:accountID LIMIT 1]; return a; } catch (DMLException e) { return null; } }
  • 25. Handling Parameters //check the existence of the query parameter if(ApexPages.currentPage().getParameters().containsKey(„id‟)) { try { Id aid = ApexPages.currentPage().getParameters().get(„id‟); Account a = [SELECT Id, Name, BillingStreet FROM Account WHERE ID =: aid]; } catch(QueryException ex) { ApexPages.addMessage(new ApexPages.Message( ApexPages.Severity.FATAL, ex.getMessage())); return; } }
  • 26. SOQL Injection String account_name = ApexPages.currentPage().getParameters().get('name'); account_name = String.escapeSingleQuotes(account_name); List<Account> accounts = Database.query('SELECT ID FROM Account WHERE Name = '+account_name);
  • 27. Cookies //Cookie = //new Cookie(String name, String value, String path, // Integer milliseconds, Boolean isHTTPSOnly) public PageReference setCookies() { Cookie companyName = new Cookie('accountName','TestCo',null,315569260,false); ApexPages.currentPage().setCookies(new Cookie[]{companyName}); return null; } public String getCookieValue() { return ApexPages.currentPage(). getCookies().get('accountName').getValue(); }
  • 28. Inheritance and Construction public with sharing class PageController implements SiteController { public PageController() { } public PageController(ApexPages.StandardController stc) { }
  • 29. Controlling Redirect //Stay on same page return null; //New page, no Viewstate PageReference newPage = new Page.NewPage(); newPage.setRedirect(true); return newPage; //New page, retain Viewstate PageReference newPage = new Page.NewPage(); newPage.setRedirect(false); return newPage;
  • 30. Unit Testing Pages //Set test page Test.setCurrentPage(Page.VisualforcePage); //Set test data Account a = new Account(Name='TestCo'); insert a; //Set test params ApexPages.currentPage().getParameters().put('id',a.Id); //Instatiate Controller SomeController controller = new SomeController(); //Make assertion System.assertEquals(controller.AccountId,a.Id)
  • 32. Visualforce Dashboards Custom Controller Dashboard Widget <apex:page controller="retrieveCase" tabStyle="Case"> <apex:pageBlock> {!contactName}s Cases <apex:pageBlockTable value="{!cases}" var="c"> <apex:column value="{!c.status}"/> <apex:column value="{!c.subject}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
  • 34. Templates Layout inserts Define with Composition <apex:page controller="compositionExample"> <apex:form > <apex:insert name=”header" /> <br /> <apex:insert name=“body" /> <apex:composition template="myFormComposition <apex:define name=”header"> <apex:outputLabel value="Enter your favorite m <apex:inputText id=”title" value="{!mealField}" </apex:define> <h2>Page Content</h2>
  • 35. Custom Components Define Attributes <apex:component controller="WarehouseAccounts <apex:attribute name="lat" type="Decimal" descrip Query" assignTo="{!lat}"/> <apex:attribute name="long" type="Decimal" desc Geolocation Query" assignTo="{!lng}"/> <apex:pageBlock > public with sharing class WarehouseAccountsCont Assign to Apex public Decimal lat {get; set;} public Decimal lng {get; set;} private List<Account> accounts; public WarehouseAccountsController() {}
  • 36. Page Embeds Standard Controller Embed in Layout <apex:page StandardController=”Account” showHeader=“false” <apex:canvasApp developerName=“warehouseDev” applicationName=“procure”
  • 37. Extending Salesforce1 with Visualforce Pages bit.ly/1f7feZN Time: 60 Minutes
  • 39. Canvas Framework for using third party apps within Salesforce
  • 40.
  • 41. Canvas Anatomy Any Language, Any Platform • • • • • 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
  • 42. Integrating Your Web Applications in Salesforce1 with Force.com Canvas http://bit.ly/1n8C4WK Time: 45 Minutes
  • 45. Apex Triggers Event based programmatic logic
  • 46. 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); //
  • 47. Delegates public class BlacklistFilterDelegate { public static Integer FEED_POST = 1; public static Integer FEED_COMMENT = 2; public static Integer USER_STATUS = 3; List<PatternHelper> patterns {set; get;} Map<Id, PatternHelper> matchedPosts {set; get;} public BlacklistFilterDelegate() { patterns = new List<PatternHelper>(); matchedPosts = new Map<Id, PatternHelper>(); preparePatterns(); }
  • 48. 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; }
  • 49. 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; } else f.RegexValue__c = RegexHelper.toRegex(f.Word__c, f.Match_Whole_Words_Only__c); } }
  • 50. Scheduled Apex Cron-like functionality to schedule Apex tasks
  • 51. 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(); }
  • 52. Schedulable Interface Via Apex Via Web UI System.schedule('testSchedule','0 0 13 * * ?', new WarehouseUtil());
  • 53. Batch Apex Functionality for Apex to run continuously in the background
  • 54. Batchable Interface global with sharing class WarehouseUtil implements Database.Batchable<sObject> { //Batch execute interface 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 }
  • 55. Unit Testing Test.StartTest(); System.schedule('testSchedule','0 0 13 * * ?',new,WarehouseUtil()); ID batchprocessid = Database.executeBatch(new WarehouseUtil()); Test.StopTest();
  • 56. OAuth Industry standard method of user authentication
  • 57. OAuth2 Flow Sends App Credentials User logs in, Token sent to callback Remote Application Confirms token Send access token Maintain session with refresh token Salesforce Platform
  • 58. Apex Endpoints Exposing Apex methods via SOAP and REST
  • 59. Apex SOAP global class MyWebService { webService static Id makeContact(String lastName, Account a) { Contact c = new Contact(lastName = 'Weissman', AccountId = a.Id); insert c; return c.id; } }
  • 60. 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/
  • 61. Apex Email Classes to handle both incoming and outgoing email
  • 62. Outgoing Email Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); String body = count+' closed records older than 90 days have been deleted'; //Set addresses based on label mail.setToAddresses(Label.emaillist.split(',')); mail.setSubject ('[Warehouse] Dated Invoices'); mail.setPlainTextBody(body); //Send the email Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
  • 63. Incoming Email global class PageHitsController implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail( Messaging.inboundEmail email, Messaging.InboundEnvelope env) { if(email.textAttachments.size() > 0) { Messaging.InboundEmail.TextAttachment csvDoc = email.textAttachments[0]; PageHitsController.uploadCSVData(csvDoc.body); } Messaging.InboundEmailResult result = new Messaging.InboundEmailResult(); result.success = true; return result; }
  • 65. Team Development Tools for teams and build masters
  • 66. Metadata API API to access customizations to the Force.com platform
  • 67. Migration Tool Ant based tool for deploying Force.com applications
  • 69. Tooling API Access, create and edit Force.com application code
  • 70. Tutorial 472 – Create an App http://bit.ly/dfc_adv_workbook Time: 30 Minutes Note: use bit.ly/1b1Runu as the Gist.
  • 71. Double-click to enter title The Wrap Up Double-click to enter text

Editor's Notes

  1. Safe Harbor
  2. Change this slide to match the local internet requirements.The bit.ly link points to the latest HTML draft of the new workbook. This is different than the official workbook on developer.force.com and there are schema differences, so attendees cannot mix and match.
  3. Here is an overview of what our data model will look like.
  4. 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.
  5. For those unfamiliar with OO, here’s what a simple class structure looks like. NOTE: If you’re using this slide deck for a very technical audience, breeze through this section and get to meatier features of Apex, otherwise go into a basic discussion about how Apex is divided into classes, refers to information with variables, etc.Now note however, the big difference – we can access and manipulate data with just a few lines of code, no additional configuration required. Apex will automatically know everything you’ve done declaratively for your application.
  6. 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 tages, 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. Do Standard Controller demo, then go back to describe custom controllers and extensions.
  7. Now that you’ve seen how controllers normally look, let’s look at a different trick Visualforce has. You can also access server-side code directly via JavaScript. The Apex code is specified with the @RemoteAction annotation, and then we can call it from JavaScript easily. This is a very lightweight approach to communicating with data. You’ll see an example of this as part of the tutorial.
  8. You can also create completely custom components with your own logic that utilize attributes you define. This makes your Visualforce portable and easy to maintain.
  9. On the flip side, Visualforce also has template support, you can define a page and which sections can be utilized, and then another page can define those sections for the template.
  10. Visualforce also has components specifically for duplicating the Chatter interface, if you want to use that with your pages.
  11. Other uses for Visualforce include creating custom email templates, embedding Visualforce into existing layouts, rendering PDF instead of HTML, creating custom Mobile interfaces and also completely overriding a page.
  12. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  13. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  14. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  15. Explain the ID trick, - for SOQL injection protection
  16. Explain the ID trick, - for SOQL injection protection
  17. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  18. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  19. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  20. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  21. We’re used to thinking about Visualforce as a component based library, and that let’s us create HTML based interfaces very quickly and easily by binding those components to data. But what about using those components to mix and match Visualforce across your instance?
  22. For instance, you can use Visualforce to create very custom dashboards, and then put those on your homepage. Here’s an example I’ve got with the Warehouse app, which is showing recently created Invoices:( /home/home.jsp )Now if I click into one of those Invoices, we’re also seeing visualforce.
  23. Because, and this is probably one of the more common use cases for Visualforce, anything with a Standard Controller can be used in place of the standard list, view, edit style pages. On this page, I’m still displaying the page layout via the detail component, but we wanted to be able to leverage a new footer across different detail pages(show WarehouseDetail
  24. And we’re keeping that new detail consistent by using a template. We can define our inserts, and then define our content. This allows us to maintain a lot of different look and feels across different object types, but controlling the parts that will the same in one place.
  25. And of course, as we customize that layout, we can create custom components which can take incoming attributes and then render what we need. For instance, in my footer I am using a visualization jQuery plugin called isotope, which allows us to view the line items in a very different way than the related list. You’ll see more about jQuery later.
  26. And of course, if I want that Visualforce in the middle of my layout, I can use a StandardController to embed that right into it. In fact, in this layout – this section is not being generated here on Salesforce.
  27. It’s actually using Canvas, which allows me to easily put third part applications into Salesforce in a secure manner.
  28. For instance, maybe I have a large internal intranet applications. I don’t want to port all that functionality into Salesforce, but I do want to be able to integrate this one interface.
  29. Apex controllers are probably the most common use case for the language, but triggers merit a second place.
  30. And with all of those potentials triggers in your system, they can easily get out of hand. There are a few best practices people have found to make them more maintainable.First, consider having only one trigger per object. Within the trigger class itself, break out every possible event, before and after, and start putting system.debugs around them. At the very least, this will make it very easy to track down in debug logs where the logic is getting fired.Second, consider handing off the actual logic to delegate classes. Send them the current scope of the trigger and let them sort it out. This will neatly divide the functionality that your trigger is trying to accomplish.
  31. A delegate also gives you more breathing room. Look at all the variables we are using to properly track what this delegate wants to do – if you started stacking all the logic into the trigger itself, this will start to get unruly really fast. Don’t let your triggers become a battleground, they should be more like highways.
  32. Another trick is using static variables in another class to track progress in your trigger. Changes to these flags will be visible for the span of the trigger context. So if, for instance, another process kicks off your trigger logic a second time, and you don’t want it to – you could swap the first flag here to true, and then not execute any logic if that flag is true.
  33. And remember one of the more powerful uses of triggers is in association with Chatter. Let’s take a look at a Force.com labs app, Chatter Blacklist, which illustrates this very well.
  34. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  35. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  36. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  37. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  38. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  39. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  40. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  41. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  42. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  43. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?
  44. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?Self Service by Email
  45. Update this subtitle
  46. How does privacy work with Chatter? Can you accidentally share a record I’m not supposed to see?