32
#forcewebinar Advanced Visualforce Development July 30, 2015

Advanced Visualforce Development with JavaScript

Embed Size (px)

Citation preview

Page 1: Advanced Visualforce Development with JavaScript

#forcewebinar

Advanced Visualforce DevelopmentJuly 30, 2015

Page 2: Advanced Visualforce Development with JavaScript

#forcewebinar

Safe HarborSafe 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 any litigation, risks associated with completed and any 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 year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These 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.

Page 3: Advanced Visualforce Development with JavaScript

#forcewebinar#forcewebinar

Speakers

Kartik ViswanadhaDirector, OpFocusSalesforce MVP@logontokartik

Page 4: Advanced Visualforce Development with JavaScript

#forcewebinar

Go Social!

Salesforce Developers

+Salesforce Developers

Salesforce Developers

Salesforce Developers The video will be posted to YouTube & the webinar recappage (same URL as registration).

This webinar is being recorded!

@salesforcedevs / #forcewebinar

Page 5: Advanced Visualforce Development with JavaScript

#forcewebinar

▪ Don’t wait until the end to ask your question! – Technical support will answer questions starting

now.

▪ Respect Q&A etiquette– Please 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

Have Questions?

Page 6: Advanced Visualforce Development with JavaScript

#forcewebinar

Pre-requisites

• Basic understanding of Apex code

• Basic understanding of Visualforce

• Basic understanding of web-based technologies like HTML, JavaScript

Page 7: Advanced Visualforce Development with JavaScript

#forcewebinar

Agenda

• Visualforce Life Cycle

• JavaScript Remoting

• Remote Objects

• Dynamic Visualforce Components

Page 8: Advanced Visualforce Development with JavaScript

#forcewebinar

Visualforce Life Cycle

• Get Requests

• Postback Request

Page 9: Advanced Visualforce Development with JavaScript

#forcewebinar

Visualforce Life Cycle – Cont.

Evaluate Constructors

Evaluate Constructors for

Components

Evaluate Expressions and actions on page

Create View State

Send HTML to Browser

GET

Decode View State

Evaluate Expressions

and all method calls

Evaluate actions that

triggered Postback

Update data & Redirect or

Update View State

Send HTML to Browser

POSTBACK

Page 10: Advanced Visualforce Development with JavaScript

#forcewebinar

JavaScript allows the Visualforce tobecome the interface you need

- Joshua Birk

• JavaScript Remoting

• Visualforce Remote Objects

• ActionFunction, ActionSupport

• JSForce, ForceTK, forceJS, ngForce

Page 11: Advanced Visualforce Development with JavaScript

#forcewebinar

JavaScript Remoting

Page 12: Advanced Visualforce Development with JavaScript

#forcewebinar

JavaScript Remoting

• A Stateless way to call Apex from JavaScript

JavaScript Function

Apex Controller

JavaScript Callback

@RemoteAction static

Page 13: Advanced Visualforce Development with JavaScript

#forcewebinar

Features of JavaScript Remoting

• Asynchronous

• No State Required

• Fast Performance

State

Page 14: Advanced Visualforce Development with JavaScript

#forcewebinar

Demo

Page 15: Advanced Visualforce Development with JavaScript

#forcewebinar

JavaScript Remoting Use cases

• Slick & Fast User Interfaces

• Third party JavaScript Libraries or Frameworks

• Mobile Applications

• Single Page Applications

• JavaScript Guru

Page 16: Advanced Visualforce Development with JavaScript

#forcewebinar

Visualforce Remote Objects

Page 17: Advanced Visualforce Development with JavaScript

#forcewebinar

Remote Objects

Account Contact Lead

Controller

Account Contact Lead

Proxy Objects

Access Definition<apex:remoteObjects>

<apex:remoteObjectModel><apex:remoteObjectField>

Data AccessRetrieve()Create()Update()Delete()

Page 18: Advanced Visualforce Development with JavaScript

#forcewebinar

Remote Objects - Overrides

• Override the standard CRUD operations

• Add logic in your Apex Controller

Page 19: Advanced Visualforce Development with JavaScript

#forcewebinar

Demo

Page 20: Advanced Visualforce Development with JavaScript

#forcewebinar

JavaScript Remoting, Remote Objects, Action Function

Page 21: Advanced Visualforce Development with JavaScript

#forcewebinar

Limits

• JavaScript Remoting• Maximum timeout of 120 sec, default 30 sec• Response size of max 15mb

• Visualforce Remote Objects• Max 100 Rows in a Single Request• No Support for Blob fields • Rendered attribute

• All Salesforce & Visualforce Service Limits

• Not counted against API

Page 22: Advanced Visualforce Development with JavaScript

#forcewebinar

Dynamic Visualforce Components

Page 23: Advanced Visualforce Development with JavaScript

#forcewebinar

Dynamic Visualforce Components

<apex:dynamicComponent componentValue="{!components}"/>

Dynamically builds the Visualforce Components

Value returned from the Apex Controller

Component.Apex.<any component> detail outputPanel ..

Page 24: Advanced Visualforce Development with JavaScript

#forcewebinar

Dynamic Visualforce Components - Architecture

Page 25: Advanced Visualforce Development with JavaScript

#forcewebinar

Demo

Page 26: Advanced Visualforce Development with JavaScript

#forcewebinar

Wrap up

▪Visualforce page LifeCycle

▪JavaScript Remoting in Visualforce

▪JavaScript Remoting Use Cases

▪Visualforce Remote Objects

▪Comparison / Pros & Cons of each feature

▪Visualforce Dynamic Components

Page 28: Advanced Visualforce Development with JavaScript

#forcewebinarChallenge Yourself! http://developer.salesforce.com/trailhead

• Interactive learning paths• Earn badges and points• Declarative and Programmatic

BRAND NEW! Introducing Trailhead

Page 29: Advanced Visualforce Development with JavaScript

#forcewebinarChallenge Yourself! http://developer.salesforce.com/trailhead

Make Trailhead your next step

Earn Visualforce Basics & Visualforce Mobile badges

http://developer.salesforce.com/trailhead

Page 30: Advanced Visualforce Development with JavaScript

#forcewebinar#forcewebinar

Survey

Your feedback is crucial to the successof our webinar programs. Thank you!

http://bit.ly/1JLFk2D

Page 31: Advanced Visualforce Development with JavaScript

#forcewebinar#forcewebinar

Jitendra ZaaSalesforce MVP@jitendrazaa

Q & A

Peter KnolleSalesforce MVP@peterknolle

Page 32: Advanced Visualforce Development with JavaScript

#forcewebinar

Thank You