Professional Documents
Culture Documents
Apex
Agenda
Model View Controller (MVC) Apex Introduction Use cases with examples
View
Controller
Build powerful apps with complex business logic & richly interactive user interfaces
View
Controller
Control Structure
Array
Data Operation
Integer NUM = 10; SOQL Account[] accs; Query // Clean up old data accs = [select id from account where name like 'test%']; delete accs; accs = new Account[NUM]; for (Integer i = 0; i < NUM; i++) { accs[i] = new Account(name='test ' + i, numberofemployees=i); } insert accs; Contact[] cons = new Contact [0]; for (Account acc : accs) { cons.add(new Contact(lastName=acc.name + '1', accountid=acc.id)); cons.add(new Contact(lastName=acc.name + '2', accountid=acc.id)); } insert cons;
Email Services
Receive emails and process contents
Implementing Triggers
Code runs when data changes to ensure business logic is applied
Visualforce
Controllers and Controller Extensions
Batch Apex
Use Cases
Data cleansing Weekly / monthly processing
Email Services
Associate Salesforce-generated email addresses to a automated process
e.g. create an email service that automatically creates contact records based on contact information in messages.
Email Service can process contents, headers, and attachments of inbound email
Example generated email address
createcontact@52jdm7gr0mnvjhbxkxtlz5k9c.in.salesforce.com
Implementing Triggers
Apex Code that executes before or after a DML event
Work in same way as database triggers DML events include: insert, update, delete, undelete Before and After events
Before triggers can update or validate values before they are saved
After triggers can access field values to affect changes in other records
Validation Error
Visualforce
Agenda
Visualforce Introduction Visualforce in MVC Use cases with examples
Introducing Visualforce
Any design for any web device
What is Visualforce?
A way to create custom graphical interfaces
with Images, JavaScript, Style Sheets, Flash, Silverlight
ASP / JSP like tag-based mark-up Uses model / controller Runs natively on salesforce servers Reusable component model
Reusable component
<apex:pageBlock title="Account Information"> <apex:pageBlockButtons> <apex:commandButton action="{!save}" value="Save" /> </apex:pageBlockButtons> <apex:pageBlockSection> <apex:inputField value="{!account.name}"/> <apex:inputField value="{!account.phone}"/> </apex:pageBlockSection>
Accessing fields
</apex:pageBlock>
Data entry form
</apex:form> </apex:page>
<apex:form>
<apex:pageBlock title="Account Information"> <apex:pageBlockButtons> <apex:commandButton action="{!save}" value="Save" /> </apex:pageBlockButtons>
Performance
Compiled code executed on servers (not JavaScript on browsers)
Canvas or design surface similar to standard Web development model Composed of HTML, Page tags and merge fields Ability to reference any CSS, Flex, AJAX or other Web technology
<apex:repeat value="{!Posts}" var="post"> <a class="title" href="/apex/blogedit?id={!post.Id}" target="_top">{!post.Name}</a> {!post.Post__c}<p>
Supports standard query strings for parameters, referenced via /apex/page_name url syntax Composed on the server, not the client
Create Standard UI elements, such as detail areas and related lists, with a single tag Built in data binding
Controllers contain the logic and data references a page uses Separates presentation from logic Created in Apex code providing full access to Apex functionality (API, Web services, etc) Pages interact with controllers through components Maintain state across page interactions Standard controllers implement normal app behavior (view, edit, save, etc)
Visualforce Examples
Visualforce Tab
Employee Directory
Button / Link
Salesforce International Mapping using Google Maps
PDF generation
Simple Quote
Sites
Wireless Craze
Integration
Agenda
Integration Introduction
Case studies
Further integration
Integration Partners
Low Complexity
Composite Apps/SOA
Enterprise Mash-ups Rich user interface
Medium Complexity
High Complexity
Application Integration
Real-time integration
Multi-step integration Human workflow
Data Integration
Data migration Data replication Bulk Data Transfers
Data Cleansing
Data deduplication Data assessment
Challenge
Wanted to integrate customer information contained within Salesforce and custom contact management application. Provide a business intelligence reporting platform
Solution
Selected Relational Junction Salesforce data replication to a relational database Used existing tool sets for a custom integration between the Relational Junction schema and internal systems
Results
Delivered a consistent view of customer data in internal systems an in Salesforce.com Able to use existing database level integration tools
Challenge
Funding based on ability to show and prove the impact for the company Dealing with multiple data sources and targets in SQL, Oracle, and others; there were 13 separate U.K. orgs form partnership Manual replication and synchronization of data Lack of confidence in same view of data Replication errors unknown Manual intervention in lead process was time consuming, costly, and inaccurate Final hurdle in cleansing program
Solution
Chose Pervasive Data Integrator: Speed of Implementation (end of Financial Year Gov. funded body) Ease of Use Automated Integration reduced manual work Scalability & Performance across multiple applications provides room for future growth
Results
No manual intervention increases accuracy and productivity One view of data Productive management of integration Ability to support business expansion Improved Reporting Fast ROI & proof of Value to Management
SAP
Challenge
Sales teams spent too much time entering account data instead of with customers Needed to increase cross- and up-selling Wanted to improve collaboration between global sales and marketing teams across 50 product lines Multiple applications produced disparate views of the customer
Solution
Implemented a 360-degree view of the customer across the company Deployed Salesforce to 800 users in 20-plus countries Integration to SAP with Web Methods Middleware, the Force.com Web Services API, and a flat file extract. SAP is used as the Account and Product Master
Results
Streamlined sales processes mean sales reps and resellers have more time to focus on selling Multilanguage & multicurrency support simplify the activities of a global organization Strong adoption drives worldwide collaboration Reps have the time to go after bigger deals and have higher visibility into the sales pipeline
Security
User Interface
Application Logic
Data Layer
Logic Integration
Master Account Check
Data Integration
Invoice Example
SAP Material Master Pushed into SFDC Custom Object via API / Data Feed
Secure
Supports Secure Sockets Layer (SSL) protocol SSLv3 Username/Password Credential Authentication Support for SAML and other token mechanisms
Exposes
Standard Salesforce Objects. Custom Salesforce Objects Custom fields on all objects
Username/Password
https
Internet
URL/Session ID Token
Request Message
Session Header
Session ID Token
Message Body
Operation = Create
sObject
https
Internet
Account
Response Message
Response
ReturnData Fault
Describe Metadata
describeGlobal (get all objects) describeSObjects (field and properties for object)
Utility
resetPassword getUserInfo
CSV and JDBC field mapping to salesforce schema Connectivity to all major Databases (Oracle, MS SQL Server, MySQL) through JDBC Interactive or Command Line use, can be scheduled
Further integration
Data services
Data Upload
Custom Logic
Outbound Messaging
Bulk API
Metadata API
Workflow