coding the salesforce1 platform user interface

26
Coding the Salesforce1 Platform User Interface June 17, 2014

Upload: bob-buzzard

Post on 15-Jan-2015

421 views

Category:

Technology


1 download

DESCRIPTION

Slide deck for my Cloud World Forum talk introducing Visualforce.

TRANSCRIPT

Page 1: Coding the Salesforce1 Platform User Interface

Coding the Salesforce1 Platform User InterfaceJune 17, 2014

Page 2: Coding the Salesforce1 Platform User Interface

Keir BowdenCTO, BrightGen@bob_buzzard

Page 3: Coding the Salesforce1 Platform User Interface

What

Why

How

Agenda

What

Page 4: Coding the Salesforce1 Platform User Interface

What is Visualforce?

User interface framework

Component based

Rich set of standard components

HTML

CSS

JavaScript

Page 5: Coding the Salesforce1 Platform User Interface

MVC Framework

ViewModel Controller

Platform provided/ Apex coded

VisualforcePage

Database /Custom classes

Page 6: Coding the Salesforce1 Platform User Interface

What

Why

How

Agenda

Why

Page 7: Coding the Salesforce1 Platform User Interface

Use case 1 – Override Standard Pages

Page 8: Coding the Salesforce1 Platform User Interface

Use Case 1 Features

Standard Controller– Required to override standard page

– Manages a Salesforce record• Account in this example

– Declarative – no Apex code

Page 9: Coding the Salesforce1 Platform User Interface

Use case 2 – Standard Page Plus!

Page 10: Coding the Salesforce1 Platform User Interface

Use Case 2 Features

Standard Controller– As use case 1

– Managing Account

Extension Controller– Coded in Apex

– Extends Standard Controller

– Managing Contacts

– Delegate to Standard Controller

Page 11: Coding the Salesforce1 Platform User Interface

Use Case 3 – Custom Functionality

Page 12: Coding the Salesforce1 Platform User Interface

Use Case 3 Features

Custom Controller– No standard controller to extend

– Coded in Apex from scratch

– Method to execute search

– All data managed in properties

Page 13: Coding the Salesforce1 Platform User Interface

Use Case 4 – External Facing Web Page

Page 14: Coding the Salesforce1 Platform User Interface

Use Case 4 Features

Any type of controller (including none)

Exclude Salesforce Styling, Elements

Regular HTML

External CSS and JavaScript Libraries

Surfaced through Force.com Site

Page 15: Coding the Salesforce1 Platform User Interface

What

Why

How

Agenda

How

Page 16: Coding the Salesforce1 Platform User Interface

Example Page - MarkupPage tag - container

Standard controller – no code!

Standard component with attributesRegular HTML

Standard component – no attributes

Closing page tag

Page 17: Coding the Salesforce1 Platform User Interface

Example Page - Output

Page 18: Coding the Salesforce1 Platform User Interface

Components

Elements on a page– Standard library – 100+

– Custom components• Functional Decomposition

• DRY

• Custom controller only

• Attributes influence behaviour

Page 19: Coding the Salesforce1 Platform User Interface

Example Component

Page 20: Coding the Salesforce1 Platform User Interface

Data Binding

Merge syntax – {! <expression> } Display fields from managed record

– <apex:page StandardController=“Account”> You are viewing <apex:outputField value=“{!Account.Name}” />.

Page 21: Coding the Salesforce1 Platform User Interface

Data Binding

Update fields from managed record<apex:page StandardController=“Account”> <apex:form> <apex:inputField value=“{!Account.Industry}” />

Page 22: Coding the Salesforce1 Platform User Interface

Data Binding

Access properties from controller– Public with public getter:

public String myStr {get; set;}

– <apex:page controller=“MyController”> <apex:form> Enter text: <apex:inputText value=“{!myStr}” />

Page 23: Coding the Salesforce1 Platform User Interface

Action Binding

Access Methods from Controllerpublic PageReference edit() { ... }

<apex:page controller=“MyController”>

<apex:form>

<apex:CommandButton value=“Edit” action=“{!edit}” />

Page 24: Coding the Salesforce1 Platform User Interface

Where Next?

https://developer.salesforce.com– Developer Portal

– Documentation, Wiki, Blogs, Forums

Developer Edition - http://bobbuzz.me.uk/1n2NND2– All Salesforce features

– Restrictions on users and records

Page 25: Coding the Salesforce1 Platform User Interface

Where Next?

Workbook - http://bobbuzz.me.uk/1lGluO9

Developer’s Guide - http://bobbuzz.me.uk/1lrw4d5

Cookbook – http://bobbuzz.me.uk/16BF214

Developer Group - http://bit.ly/DUGLondon

Page 26: Coding the Salesforce1 Platform User Interface

Thank You