SlideShare a Scribd company logo
Visualforce in Salesforce1
Optimizing your User Interface for Mobile
May 14, 2014
#forcewebinar
Speakers
Dave Carroll
Director, Developer Evangelism
@dcarroll
Pat Patterson
Developer Evangelist Architect
@metadaddy
#forcewebinar
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 product or service
availability, 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, new products and services, 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, the outcome of intellectual property and other litigation, 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-Q for the most recent fiscal quarter ended July 31, 2012. This documents and
others containing important disclosures 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 presentations, 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.
#forcewebinar
Follow Salesforce Developers for the Latest News
Salesforce Developers
+Salesforce Developers
Salesforce Developers
Salesforce Developers The video will be posted to YouTube
& the webinar recap page
(same URL as registration).
This webinar is being recorded!
@salesforcedevs / #forcewebinar
#forcewebinar
Have Questions?
§  Don’t wait until the end to ask your question!
–  Technical support will answer questions starting now.
§  Respect Q&A etiquette
–  Don’t repeat questions. The support team is working their way
down the queue.
§  Stick around for live Q&A at the end
–  Speakers will tackle more questions at the end, time-allowing.
§  Head to Developer Forums
–  More questions? Visit developer.salesforce.com/forums
#forcewebinar
Introducing Salesforce1
All your past investments...
Drag and drop UI
customization
Notifications
Platform
Publisher
Actions
...now in the future
All Your
Customizations
All Your Devices
All Your CRM
All Your Apps
https://yourinstance.salesforce.com/one/one.app
Download the Salesforce1 Mobile App today
#forcewebinar
Visualforce in Salesforce1
§  Where can I use it?
§  How do I use it?
§  How can I make the most of it?
#forcewebinar
Visualforce in Salesforce1
§  Where can I use it?
§  How do I use it?
§  How can I make the most of it?
#forcewebinar
Visualforce – Left Nav
Visualforce Pages in Left Nav
JavaScript navigation library available
sforce.one.navigateToSObject etc.
#forcewebinar
Visualforce – Publisher Actions
Visualforce Pages as Publisher Actions
(VF page needs to the extend Standard Controller for
use with Object Specific Publisher Actions)
JavaScript Pub-Sub library available to interact with the
publisher
publisher.setValidForSubmit
publisher.post
publisher.close
#forcewebinar
Visualforce – Page Layout
Visualforce Pages in Page Layouts
(VF page needs to the extend Standard Controller)
#forcewebinar
Visualforce – Mobile Cards
Mobile Cards - Visualforce Pages on
Record Detail
(VF page needs to the extend Standard Controller)
#forcewebinar
Demo:
Basic Visualforce in Salesforce1
#forcewebinar
Visualforce in Salesforce1
§  <apex:page docType="html-5.0" …>
§  ‘Available for Salesforce Mobile apps’ flag enabled
§  VF page needs to the extend Standard Controller in order to use in the
Page Layout, Mobile Cards or Contextual Publisher Actions
Things to remember…
#forcewebinar
Visualforce in Salesforce1
§  Where can I use it?
§  How do I use it?
–  UI/UX
–  Business Logic & Data Binding
–  Navigation
§  How can I make the most of it?
#forcewebinar
Visualforce in Salesforce1
§  Where can I use it?
§  How do I use it?
–  UI/UX
–  Business Logic & Data Binding
–  Navigation
§  How can I make the most of it?
#forcewebinar
Visualforce in Salesforce1 – UI/UX considerations
Salesforce1 cannot auto-magically
(yes, it’s a word) make Visualforce
pages mobile-optimized
#forcewebinar
Visualforce UI/UX considerations
§  Design VF pages taking the limited real-estate in mobile into account
§  Decide which form-factors your page has to support - phone, tablet, both
§  Develop for the mobile context
–  Use device features like geolocation, camera etc. where appropriate
–  Mobile version of the page/app does not have to support all the bells and whistles –
less is more
–  Optimize for your most common mobile use case – discovery, data entry, search etc.
§  <apex:page standardStylesheets="false">
§  Use Responsive Design principles (same as the Salesforce1 app)
#forcewebinar
Making Visualforce Pages Mobile Optimized
Mobile Design Templates
www.developerforce.com/mobile/services/mobile-templates
#forcewebinar
Making Visualforce Pages Mobile Optimized
Twitter Bootstrap
http://www.youtube.com/watch?v=sIWchyCqDa4
Using Visualforce and Bootstrap -
http://bit.ly/VisualStrap
Custom Bootstrap fork that works with default
Visualforce styling (Community developed)
#forcewebinar
Making Visualforce Pages Mobile Optimized
Ionic Framework
http://coenraets.org/blog/2014/02/sample-force-com-mobile-
application-with-ionic-and-angularjs/
#forcewebinar
Making Visualforce Pages Mobile Optimized
Ratchet
http://coenraets.org/blog/2014/03/building-mobile-apps-for-
salesforce-com-with-ratchet-2-0/
#forcewebinar
Making Visualforce Pages Mobile Optimized
jQuery Mobile
http://www.developerforce.com/mobile/getting-started/
html5/#jquery
#forcewebinar
Using Standard Visualforce Tags in Salesforce1
<apex:repeat> <apex:outputPanel>
Note: Representative sample only. This is not a
comprehensive list
<apex:pageBlock> <apex:pageBlockButtons>
<apex:pageBlockSection> <apex:pageBlockSectionItem>
<apex:pageBlockTable> <apex:inlineEditSupport>
<apex:detail> <apex:inputField>**
<apex:enhancedList> <apex:listViews> <apex:relatedList>
<chatter:*> <liveagent:*>
Works and
Supported
Supported,
but avoid if
possible
Not
Supported
#forcewebinar
Salesforce1 Style Guide
http://sfdc-styleguide.herokuapp.com/
Keeping Visualforce pages consistent with the Salesforce1 look and feel
#forcewebinar
Salesforce1 Style Guide
https://github.com/joshbirk/onestarter
OneStarter - An open-source jQuery plugin for easily making Visualforce
pages appear in the style of Salesforce1.
#forcewebinar
Visualforce in Salesforce1 - UI/UX summary
Dos Don’ts
Responsive design Desktop optimized design
Standard HTML markup and custom
CSS
Standard VF structure tags and CSS
Less is more Support every bell and whistle
Use Mobile Context (e.g. camera,
geolocation)
Recreate desktop functionality
Optimized for touch (e.g. larger tap
areas, HTML5 form inputs)
Optimized for click
#forcewebinar
Visualforce in Salesforce1
§  Where can I use it?
§  How do I use it?
–  UI/UX
–  Business Logic & Data Binding
–  Navigation
§  How can I make the most of it?
#forcewebinar
§  Avoid ViewState (no <apex:form>)
§  Favor Single Page apps (full page rendering is expensive on mobile)
§  Consider JavaScript MV* Frameworks like AngularJS, Backbone etc. to
provide structure
Business Logic & Data Binding in Visualforce
Top 3 things to remember….
#forcewebinar
Business Logic & Data Binding in Visualforce
§  Invoke Apex Controller/Extension
methods from JavaScript
§  Avoids ViewState (better performance)
§  Stateless business logic
§  Front-end heavy (i.e. JavaScript)
development
JavaScript Remoting
#forcewebinar
Business Logic & Data Binding in Visualforce
§  Basic CRUD operations on SObjects
directly from JavaScript
§  Avoids ViewState (better performance)
§  Reduces server-side Apex code
§  Front-end heavy (i.e. JavaScript)
development
§  Replaces ForceTk/RemoteTk (in the VF
context)
Visualforce Remote Objects (new Pilot in Spring ’14)
#forcewebinar
Business Logic & Data Binding in Visualforce
§  Use <apex:repeat> to display
lists
<apex:repeat> is your friend
#forcewebinar
Visualforce in Salesforce1 – Data Binding summary
Dos Don’ts
JavaScript Remoting <apex:form>
Visualforce Remote Objects <apex:form>
HTML5 Input Elements (tel, email, date
etc.)
<apex:inputField>
<apex:input type=“tel/email/…”/> <apex:inputField>
Single Page apps Multi-page apps
JavaScript MV* Frameworks like
AngularJS, Backbone etc.
No JavaScript Framework
Stateless & Asynchronous Server-side state & synchronous
#forcewebinar
Visualforce in Salesforce1
§  Where can I use it?
§  How do I use it?
–  UI/UX
–  Business Logic & Data Binding
–  Navigation
§  How can I make the most of it?
#forcewebinar
Visualforce in Salesforce1 - Navigation
Salesforce1 provides a JavaScript navigation library via the sforce.one
object
sforce.one.navigateToSObject
sforce.one.navigateToURL
sforce.one.navigateToFeed
sforce.one.navigateToFeedItemDetail
sforce.one.navigateToRelatedList
sforce.one.navigateToList
sforce.one.editRecord
sforce.one.createRecord
#forcewebinar
Demo:
Visualforce Single Page App in
Salesforce1
#forcewebinar
Visualforce in Salesforce1
§  Where can I use it?
§  How do I use it?
–  UI/UX
–  Business Logic & Data Binding
–  Navigation
§  How can I make the most of it?
–  Performance
–  Debugging
#forcewebinar
Visualforce in Salesforce1
§  Where can I use it?
§  How do I use it?
–  UI/UX
–  Business Logic & Data Binding
–  Navigation
§  How can I make the most of it?
–  Performance
–  Debugging
#forcewebinar
Visualforce Performance in Salesforce1
The 3 most important things about developing mobile web pages
Performance, Performance, Performance.
#forcewebinar
Visualforce Performance in Salesforce1
Some Performance tips for designing mobile VF pages
§  Avoid viewstate (no <apex:form>)
§  <apex:page cache="true" expires="600">
§  Minimize all your CSS and JavaScript (using tools like YUI Compressor) and compress images
§  Use optimization techniques like image lazy loading and infinite scroll
§  Insert/update the DOM in bulk to avoid browser reflows (e.g. insert an entire <ul> section
instead of individual <li> elements)
General
#forcewebinar
Visualforce Performance in Salesforce1
Some Performance tips for designing mobile VF pages
§  Use libraries like FastClick to avoid the default 300ms tap delay in mobile web browsers
§  Use lightweight JavaScript libraries like Zepto.js instead of Jquery
§  Move your <script> statements to the end of the Visualforce page
JavaScript
#forcewebinar
Visualforce Performance in Salesforce1
Some Performance tips for designing mobile VF pages
§  Use CSS Sprites to minimize HTTP connections
§  Avoid CSS techniques like drop shadows, gradients etc. that affect page performance. Flat
design is new black.
§  Use Hardware Accelerated CSS properties where appropriate
§  Use PNG/JPG images (no GIFs). Avoid images completely (use CSS3 instead) where possible.
§  Build single page apps with CSS transitions between screens/sections
§  Conditionally load static assets (CSS, images etc.) based on form factor
CSS/Images
#forcewebinar
Visualforce Performance in Salesforce1
Some Tools to help you measure page performance
§  WebPageTest
§  PageSpeed Insights
§  Chrome Developer Tools - Timeline
#forcewebinar
Visualforce in Salesforce1
§  Where can I use it?
§  How do I use it?
–  UI/UX
–  Business Logic & Data Binding
–  Navigation
§  How can I make the most of it?
–  Performance
–  Debugging
#forcewebinar
Salesforce1 comes in two flavors
http://yourinstance.salesforce.com/one/one.app
Web version Hybrid version
Debugging Visualforce in Salesforce1
#forcewebinar
Debug your Visualforce page in the web version of Salesforce1 first
http://yourinstance.salesforce.com/one/one.app
Debugging Visualforce in Salesforce1
Use standard web debugging
tools like Chrome Developer Tools
and Firebug
Chrome Developer Tools Mobile
Emulation
#forcewebinar
Debugging Visualforce pages running on a device
(i.e. inside the Hybrid Salesforce1 app)
http://people.apache.org/~pmuellr/weinre/docs/latest/
Debugging Visualforce in Salesforce1
Weinre – open source tool to debug web pages running on a device
#forcewebinar
Salesforce1 Developer Resources
§  Webinar: Intro to Salesforce1 Mobile App Development
–  bit.ly/s1-mob-app-dev
§  Dreamforce Sessions: bit.ly/s1-df-sessions
§  Developer Guide: bit.ly/s1-dev-guide
§  Blogs:
–  6 things you need to know: bit.ly/s1-6-things
–  Mobile cards: bit.ly/s1-mobile-cards
§  Code:
–  Issues in GitHub: github.com/metadaddy-sfdc/IssuesInGitHub
–  Visualforce, AngularJS & Ionic: bit.ly/vf-ionic
#forcewebinar
Survey
Your feedback is crucial to the success
of our webinar programs. Thank you!
bit.ly/VFinSF1
#forcewebinar
#forcewebinar
Q & A
#forcewebinar
Dave Carroll
Director, Developer Evangelism
@dcarroll
Pat Patterson
Developer Evangelist Architect
@metadaddy

More Related Content

PDF
Intro to Force.com Canvas: Running External Apps within the Salesforce UI Web...
PDF
Making External Web Pages Interact With Visualforce
PDF
Using Visualforce in Salesforce1
PDF
Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...
PPTX
Salesforce Flows Architecture Best Practices
PPTX
Salesforce developer training presentation slides
PPTX
Introduction to Apex for Developers
PPTX
Secure Coding: Field-level Security, CRUD, and Sharing
Intro to Force.com Canvas: Running External Apps within the Salesforce UI Web...
Making External Web Pages Interact With Visualforce
Using Visualforce in Salesforce1
Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...
Salesforce Flows Architecture Best Practices
Salesforce developer training presentation slides
Introduction to Apex for Developers
Secure Coding: Field-level Security, CRUD, and Sharing

What's hot (20)

PDF
Development Best Practices
PPT
Testing capability ppt
PDF
Event Monitoring: Use Powerful Insights to Improve Performance and Security
PDF
Lightning アプリケーション開発 - Visualforce ページの移行
PDF
Welcome to the Government Success Platform
PPT
Ppt of soap ui
PPTX
Seamless Authentication with Force.com Canvas
PPTX
Salesforce Service Cloud 2
PDF
Performance Monitoring and Testing in the Salesforce Cloud
PDF
SalesForce Consulting Service & Customization
PDF
Performing a successful technical debt assessment in Salesforce
PPTX
Salesforce Security Review Tips and Tricks
PDF
Coding for Declarative Customizations: How We Do It in Salesforce.com IT
PDF
Sales Cloud Best Practices
PPTX
Salesforce online training SFDC online course
PDF
Planning Your Migration to the Lightning Experience
PPTX
Salesforce administrator training presentation slides
PDF
Manage Salesforce Like a Pro with Governance
PPT
Performance testing using hp load runner
PDF
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Development Best Practices
Testing capability ppt
Event Monitoring: Use Powerful Insights to Improve Performance and Security
Lightning アプリケーション開発 - Visualforce ページの移行
Welcome to the Government Success Platform
Ppt of soap ui
Seamless Authentication with Force.com Canvas
Salesforce Service Cloud 2
Performance Monitoring and Testing in the Salesforce Cloud
SalesForce Consulting Service & Customization
Performing a successful technical debt assessment in Salesforce
Salesforce Security Review Tips and Tricks
Coding for Declarative Customizations: How We Do It in Salesforce.com IT
Sales Cloud Best Practices
Salesforce online training SFDC online course
Planning Your Migration to the Lightning Experience
Salesforce administrator training presentation slides
Manage Salesforce Like a Pro with Governance
Performance testing using hp load runner
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Ad

Viewers also liked (14)

PPTX
Responsive Web Design with Visualforce
PDF
Jp visualforce in salesforce1
PDF
Make Your Visualforce Pages Responsive
PPTX
Salesforce1 for Visualforce Developers
PDF
Taking Flow to the Next Level with Just Enough Code
PDF
Introduction to Visualforce Webinar
PDF
Introduction to Visualforce
PDF
Lightning を利用した開発とケーススタディ
PDF
Lightning Force Eventの紹介
PPTX
SF1 - Apex Development Best Practises
PPTX
Force.com Canvas: Salesforce1, SAML, & Apex...Oh My!
PDF
PHP開発者のためのHeroku入門
PPT
Salesforce Presentation
PDF
Style Guide Best Practices
Responsive Web Design with Visualforce
Jp visualforce in salesforce1
Make Your Visualforce Pages Responsive
Salesforce1 for Visualforce Developers
Taking Flow to the Next Level with Just Enough Code
Introduction to Visualforce Webinar
Introduction to Visualforce
Lightning を利用した開発とケーススタディ
Lightning Force Eventの紹介
SF1 - Apex Development Best Practises
Force.com Canvas: Salesforce1, SAML, & Apex...Oh My!
PHP開発者のためのHeroku入門
Salesforce Presentation
Style Guide Best Practices
Ad

Similar to Visualforce in Salesforce1: Optimizing your User Interface for Mobile (20)

PPTX
Building JavaScript Applications on the Salesforce1 Platform
PDF
Salesforce1 for ISVs Webinar (May 15, 2014)
PPTX
Building Mobile Apps on Salesforce Platform with Mobile SDK
PDF
Salesforce1 for ISVs Webinar (July 17, 2014)
PPTX
Singapore dev user group
PPTX
Become a Hero of Mobile: Salesforce1 Mobile App Best Practices for Admins
PPTX
How Salesforce.com uses the Salesforce1 Mobile App
PDF
Building Enterprise Apps Rapidly with Salesforce Mobile Packs Webinar
PDF
Force.com Friday: Intro to Force.com
PPTX
JavaScript Integration with Visualforce
PPTX
Webinar May 15th - Intro to salesforce1 mobile app development no code
PPTX
Winter '15 Release-Overview and Highlights
PDF
Intro to Building Mobile Apps with Salesforce1: No Code Required Webinar
PDF
Salesforce1 for Developers
PPTX
Force.com Friday - Intro to Visualforce
PPTX
Salesforce1 for Developers
PPTX
Java Best Practices - Tools, Performance, and Deployment
PPTX
Entwicklung angepasster User Interfaces für Salesforce1
PPTX
Force.com Friday: Intro to Visualforce (May 8, 2015)
PPTX
Webinar using salesforce1 to manage your salesforce org final
Building JavaScript Applications on the Salesforce1 Platform
Salesforce1 for ISVs Webinar (May 15, 2014)
Building Mobile Apps on Salesforce Platform with Mobile SDK
Salesforce1 for ISVs Webinar (July 17, 2014)
Singapore dev user group
Become a Hero of Mobile: Salesforce1 Mobile App Best Practices for Admins
How Salesforce.com uses the Salesforce1 Mobile App
Building Enterprise Apps Rapidly with Salesforce Mobile Packs Webinar
Force.com Friday: Intro to Force.com
JavaScript Integration with Visualforce
Webinar May 15th - Intro to salesforce1 mobile app development no code
Winter '15 Release-Overview and Highlights
Intro to Building Mobile Apps with Salesforce1: No Code Required Webinar
Salesforce1 for Developers
Force.com Friday - Intro to Visualforce
Salesforce1 for Developers
Java Best Practices - Tools, Performance, and Deployment
Entwicklung angepasster User Interfaces für Salesforce1
Force.com Friday: Intro to Visualforce (May 8, 2015)
Webinar using salesforce1 to manage your salesforce org final

More from Salesforce Developers (20)

PDF
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
PDF
Maximizing Salesforce Lightning Experience and Lightning Component Performance
PDF
Local development with Open Source Base Components
PPTX
TrailheaDX India : Developer Highlights
PDF
Why developers shouldn’t miss TrailheaDX India
PPTX
CodeLive: Build Lightning Web Components faster with Local Development
PPTX
CodeLive: Converting Aura Components to Lightning Web Components
PPTX
Enterprise-grade UI with open source Lightning Web Components
PPTX
TrailheaDX and Summer '19: Developer Highlights
PDF
Live coding with LWC
PDF
Lightning web components - Episode 4 : Security and Testing
PDF
LWC Episode 3- Component Communication and Aura Interoperability
PDF
Lightning web components episode 2- work with salesforce data
PDF
Lightning web components - Episode 1 - An Introduction
PDF
Migrating CPQ to Advanced Calculator and JSQCP
PDF
Scale with Large Data Volumes and Big Objects in Salesforce
PDF
Replicate Salesforce Data in Real Time with Change Data Capture
PDF
Modern Development with Salesforce DX
PDF
Get Into Lightning Flow Development
PDF
Integrate CMS Content Into Lightning Communities with CMS Connect
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Local development with Open Source Base Components
TrailheaDX India : Developer Highlights
Why developers shouldn’t miss TrailheaDX India
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Converting Aura Components to Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
TrailheaDX and Summer '19: Developer Highlights
Live coding with LWC
Lightning web components - Episode 4 : Security and Testing
LWC Episode 3- Component Communication and Aura Interoperability
Lightning web components episode 2- work with salesforce data
Lightning web components - Episode 1 - An Introduction
Migrating CPQ to Advanced Calculator and JSQCP
Scale with Large Data Volumes and Big Objects in Salesforce
Replicate Salesforce Data in Real Time with Change Data Capture
Modern Development with Salesforce DX
Get Into Lightning Flow Development
Integrate CMS Content Into Lightning Communities with CMS Connect

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
cuic standard and advanced reporting.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
Teaching material agriculture food technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Dropbox Q2 2025 Financial Results & Investor Presentation
The AUB Centre for AI in Media Proposal.docx
MYSQL Presentation for SQL database connectivity
Encapsulation_ Review paper, used for researhc scholars
cuic standard and advanced reporting.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Building Integrated photovoltaic BIPV_UPV.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Unlocking AI with Model Context Protocol (MCP)
Understanding_Digital_Forensics_Presentation.pptx
sap open course for s4hana steps from ECC to s4
Advanced methodologies resolving dimensionality complications for autism neur...
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing

Visualforce in Salesforce1: Optimizing your User Interface for Mobile

  • 1. Visualforce in Salesforce1 Optimizing your User Interface for Mobile May 14, 2014
  • 2. #forcewebinar Speakers Dave Carroll Director, Developer Evangelism @dcarroll Pat Patterson Developer Evangelist Architect @metadaddy
  • 3. #forcewebinar 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 product or service availability, 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, new products and services, 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, the outcome of intellectual property and other litigation, 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-Q for the most recent fiscal quarter ended July 31, 2012. This documents and others containing important disclosures 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 presentations, 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. #forcewebinar Follow Salesforce Developers for the Latest News Salesforce Developers +Salesforce Developers Salesforce Developers Salesforce Developers The video will be posted to YouTube & the webinar recap page (same URL as registration). This webinar is being recorded! @salesforcedevs / #forcewebinar
  • 5. #forcewebinar Have Questions? §  Don’t wait until the end to ask your question! –  Technical support will answer questions starting now. §  Respect Q&A etiquette –  Don’t repeat questions. The support team is working their way down the queue. §  Stick around for live Q&A at the end –  Speakers will tackle more questions at the end, time-allowing. §  Head to Developer Forums –  More questions? Visit developer.salesforce.com/forums
  • 6. #forcewebinar Introducing Salesforce1 All your past investments... Drag and drop UI customization Notifications Platform Publisher Actions ...now in the future All Your Customizations All Your Devices All Your CRM All Your Apps https://yourinstance.salesforce.com/one/one.app Download the Salesforce1 Mobile App today
  • 7. #forcewebinar Visualforce in Salesforce1 §  Where can I use it? §  How do I use it? §  How can I make the most of it?
  • 8. #forcewebinar Visualforce in Salesforce1 §  Where can I use it? §  How do I use it? §  How can I make the most of it?
  • 9. #forcewebinar Visualforce – Left Nav Visualforce Pages in Left Nav JavaScript navigation library available sforce.one.navigateToSObject etc.
  • 10. #forcewebinar Visualforce – Publisher Actions Visualforce Pages as Publisher Actions (VF page needs to the extend Standard Controller for use with Object Specific Publisher Actions) JavaScript Pub-Sub library available to interact with the publisher publisher.setValidForSubmit publisher.post publisher.close
  • 11. #forcewebinar Visualforce – Page Layout Visualforce Pages in Page Layouts (VF page needs to the extend Standard Controller)
  • 12. #forcewebinar Visualforce – Mobile Cards Mobile Cards - Visualforce Pages on Record Detail (VF page needs to the extend Standard Controller)
  • 14. #forcewebinar Visualforce in Salesforce1 §  <apex:page docType="html-5.0" …> §  ‘Available for Salesforce Mobile apps’ flag enabled §  VF page needs to the extend Standard Controller in order to use in the Page Layout, Mobile Cards or Contextual Publisher Actions Things to remember…
  • 15. #forcewebinar Visualforce in Salesforce1 §  Where can I use it? §  How do I use it? –  UI/UX –  Business Logic & Data Binding –  Navigation §  How can I make the most of it?
  • 16. #forcewebinar Visualforce in Salesforce1 §  Where can I use it? §  How do I use it? –  UI/UX –  Business Logic & Data Binding –  Navigation §  How can I make the most of it?
  • 17. #forcewebinar Visualforce in Salesforce1 – UI/UX considerations Salesforce1 cannot auto-magically (yes, it’s a word) make Visualforce pages mobile-optimized
  • 18. #forcewebinar Visualforce UI/UX considerations §  Design VF pages taking the limited real-estate in mobile into account §  Decide which form-factors your page has to support - phone, tablet, both §  Develop for the mobile context –  Use device features like geolocation, camera etc. where appropriate –  Mobile version of the page/app does not have to support all the bells and whistles – less is more –  Optimize for your most common mobile use case – discovery, data entry, search etc. §  <apex:page standardStylesheets="false"> §  Use Responsive Design principles (same as the Salesforce1 app)
  • 19. #forcewebinar Making Visualforce Pages Mobile Optimized Mobile Design Templates www.developerforce.com/mobile/services/mobile-templates
  • 20. #forcewebinar Making Visualforce Pages Mobile Optimized Twitter Bootstrap http://www.youtube.com/watch?v=sIWchyCqDa4 Using Visualforce and Bootstrap - http://bit.ly/VisualStrap Custom Bootstrap fork that works with default Visualforce styling (Community developed)
  • 21. #forcewebinar Making Visualforce Pages Mobile Optimized Ionic Framework http://coenraets.org/blog/2014/02/sample-force-com-mobile- application-with-ionic-and-angularjs/
  • 22. #forcewebinar Making Visualforce Pages Mobile Optimized Ratchet http://coenraets.org/blog/2014/03/building-mobile-apps-for- salesforce-com-with-ratchet-2-0/
  • 23. #forcewebinar Making Visualforce Pages Mobile Optimized jQuery Mobile http://www.developerforce.com/mobile/getting-started/ html5/#jquery
  • 24. #forcewebinar Using Standard Visualforce Tags in Salesforce1 <apex:repeat> <apex:outputPanel> Note: Representative sample only. This is not a comprehensive list <apex:pageBlock> <apex:pageBlockButtons> <apex:pageBlockSection> <apex:pageBlockSectionItem> <apex:pageBlockTable> <apex:inlineEditSupport> <apex:detail> <apex:inputField>** <apex:enhancedList> <apex:listViews> <apex:relatedList> <chatter:*> <liveagent:*> Works and Supported Supported, but avoid if possible Not Supported
  • 26. #forcewebinar Salesforce1 Style Guide https://github.com/joshbirk/onestarter OneStarter - An open-source jQuery plugin for easily making Visualforce pages appear in the style of Salesforce1.
  • 27. #forcewebinar Visualforce in Salesforce1 - UI/UX summary Dos Don’ts Responsive design Desktop optimized design Standard HTML markup and custom CSS Standard VF structure tags and CSS Less is more Support every bell and whistle Use Mobile Context (e.g. camera, geolocation) Recreate desktop functionality Optimized for touch (e.g. larger tap areas, HTML5 form inputs) Optimized for click
  • 28. #forcewebinar Visualforce in Salesforce1 §  Where can I use it? §  How do I use it? –  UI/UX –  Business Logic & Data Binding –  Navigation §  How can I make the most of it?
  • 29. #forcewebinar §  Avoid ViewState (no <apex:form>) §  Favor Single Page apps (full page rendering is expensive on mobile) §  Consider JavaScript MV* Frameworks like AngularJS, Backbone etc. to provide structure Business Logic & Data Binding in Visualforce Top 3 things to remember….
  • 30. #forcewebinar Business Logic & Data Binding in Visualforce §  Invoke Apex Controller/Extension methods from JavaScript §  Avoids ViewState (better performance) §  Stateless business logic §  Front-end heavy (i.e. JavaScript) development JavaScript Remoting
  • 31. #forcewebinar Business Logic & Data Binding in Visualforce §  Basic CRUD operations on SObjects directly from JavaScript §  Avoids ViewState (better performance) §  Reduces server-side Apex code §  Front-end heavy (i.e. JavaScript) development §  Replaces ForceTk/RemoteTk (in the VF context) Visualforce Remote Objects (new Pilot in Spring ’14)
  • 32. #forcewebinar Business Logic & Data Binding in Visualforce §  Use <apex:repeat> to display lists <apex:repeat> is your friend
  • 33. #forcewebinar Visualforce in Salesforce1 – Data Binding summary Dos Don’ts JavaScript Remoting <apex:form> Visualforce Remote Objects <apex:form> HTML5 Input Elements (tel, email, date etc.) <apex:inputField> <apex:input type=“tel/email/…”/> <apex:inputField> Single Page apps Multi-page apps JavaScript MV* Frameworks like AngularJS, Backbone etc. No JavaScript Framework Stateless & Asynchronous Server-side state & synchronous
  • 34. #forcewebinar Visualforce in Salesforce1 §  Where can I use it? §  How do I use it? –  UI/UX –  Business Logic & Data Binding –  Navigation §  How can I make the most of it?
  • 35. #forcewebinar Visualforce in Salesforce1 - Navigation Salesforce1 provides a JavaScript navigation library via the sforce.one object sforce.one.navigateToSObject sforce.one.navigateToURL sforce.one.navigateToFeed sforce.one.navigateToFeedItemDetail sforce.one.navigateToRelatedList sforce.one.navigateToList sforce.one.editRecord sforce.one.createRecord
  • 37. #forcewebinar Visualforce in Salesforce1 §  Where can I use it? §  How do I use it? –  UI/UX –  Business Logic & Data Binding –  Navigation §  How can I make the most of it? –  Performance –  Debugging
  • 38. #forcewebinar Visualforce in Salesforce1 §  Where can I use it? §  How do I use it? –  UI/UX –  Business Logic & Data Binding –  Navigation §  How can I make the most of it? –  Performance –  Debugging
  • 39. #forcewebinar Visualforce Performance in Salesforce1 The 3 most important things about developing mobile web pages Performance, Performance, Performance.
  • 40. #forcewebinar Visualforce Performance in Salesforce1 Some Performance tips for designing mobile VF pages §  Avoid viewstate (no <apex:form>) §  <apex:page cache="true" expires="600"> §  Minimize all your CSS and JavaScript (using tools like YUI Compressor) and compress images §  Use optimization techniques like image lazy loading and infinite scroll §  Insert/update the DOM in bulk to avoid browser reflows (e.g. insert an entire <ul> section instead of individual <li> elements) General
  • 41. #forcewebinar Visualforce Performance in Salesforce1 Some Performance tips for designing mobile VF pages §  Use libraries like FastClick to avoid the default 300ms tap delay in mobile web browsers §  Use lightweight JavaScript libraries like Zepto.js instead of Jquery §  Move your <script> statements to the end of the Visualforce page JavaScript
  • 42. #forcewebinar Visualforce Performance in Salesforce1 Some Performance tips for designing mobile VF pages §  Use CSS Sprites to minimize HTTP connections §  Avoid CSS techniques like drop shadows, gradients etc. that affect page performance. Flat design is new black. §  Use Hardware Accelerated CSS properties where appropriate §  Use PNG/JPG images (no GIFs). Avoid images completely (use CSS3 instead) where possible. §  Build single page apps with CSS transitions between screens/sections §  Conditionally load static assets (CSS, images etc.) based on form factor CSS/Images
  • 43. #forcewebinar Visualforce Performance in Salesforce1 Some Tools to help you measure page performance §  WebPageTest §  PageSpeed Insights §  Chrome Developer Tools - Timeline
  • 44. #forcewebinar Visualforce in Salesforce1 §  Where can I use it? §  How do I use it? –  UI/UX –  Business Logic & Data Binding –  Navigation §  How can I make the most of it? –  Performance –  Debugging
  • 45. #forcewebinar Salesforce1 comes in two flavors http://yourinstance.salesforce.com/one/one.app Web version Hybrid version Debugging Visualforce in Salesforce1
  • 46. #forcewebinar Debug your Visualforce page in the web version of Salesforce1 first http://yourinstance.salesforce.com/one/one.app Debugging Visualforce in Salesforce1 Use standard web debugging tools like Chrome Developer Tools and Firebug Chrome Developer Tools Mobile Emulation
  • 47. #forcewebinar Debugging Visualforce pages running on a device (i.e. inside the Hybrid Salesforce1 app) http://people.apache.org/~pmuellr/weinre/docs/latest/ Debugging Visualforce in Salesforce1 Weinre – open source tool to debug web pages running on a device
  • 48. #forcewebinar Salesforce1 Developer Resources §  Webinar: Intro to Salesforce1 Mobile App Development –  bit.ly/s1-mob-app-dev §  Dreamforce Sessions: bit.ly/s1-df-sessions §  Developer Guide: bit.ly/s1-dev-guide §  Blogs: –  6 things you need to know: bit.ly/s1-6-things –  Mobile cards: bit.ly/s1-mobile-cards §  Code: –  Issues in GitHub: github.com/metadaddy-sfdc/IssuesInGitHub –  Visualforce, AngularJS & Ionic: bit.ly/vf-ionic
  • 49. #forcewebinar Survey Your feedback is crucial to the success of our webinar programs. Thank you! bit.ly/VFinSF1 #forcewebinar
  • 50. #forcewebinar Q & A #forcewebinar Dave Carroll Director, Developer Evangelism @dcarroll Pat Patterson Developer Evangelist Architect @metadaddy