Alert! Event Notification Options for Force.com Apps Webinar
Upcoming SlideShare
Loading in...5
×
 

Alert! Event Notification Options for Force.com Apps Webinar

on

  • 1,587 views

Event notification is an important part of most business applications. When something important happens, you sometimes need one or more users to take a specific action. This intermediate- to advanced- ...

Event notification is an important part of most business applications. When something important happens, you sometimes need one or more users to take a specific action. This intermediate- to advanced- level webinar teaches you all about event notification, contrasts the different Salesforce features you can use to implement it, and shows you practical examples of how to use those Salesforce features to suit your specific event notification use case.

Key Takeaways
:: Understand how use case requirements help you determine the appropriate Force.com feature to use for event notification.
:: Implement and contrast event notification with Visualforce pages that poll, Visualforce pages that use the Force.com Streaming API, workflow rules, Chatter feeds and scheduled reports.

Intended Audience
:: This intermediate-level webinar is geared towards Force.com application developers and architects.

Statistics

Views

Total Views
1,587
Views on SlideShare
654
Embed Views
933

Actions

Likes
1
Downloads
42
Comments
0

4 Embeds 933

http://www2.developerforce.com 451
http://events.developerforce.com 308
https://developer.salesforce.com 173
https://staging.developer.salesforce.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Alert! Event Notification Options for Force.com Apps Webinar Alert! Event Notification Options for Force.com Apps Webinar Presentation Transcript

  • Alert! Event Notification Options for Force.com Apps October 16, 2013
  • 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 nonsalesforce.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
  • Speakers Steve Bobrowski Architect Evangelist @sbob909 #forcewebinar Josh Birk Developer Evangelist @JoshBirk
  • Follow Developer Force for the Latest News @forcedotcom / #forcewebinar Developer Force – Force.com Community +DeveloperForce – Force.com Community Developer Force Developer Force Group #forcewebinar
  • Architect Core Resources page developer.force.com/architect #forcewebinar
  • Have Questions? §  We have an expert support team at the ready to answer your questions during the webinar. §  Ask your questions via the GoToWebinar Questions Pane. §  The speaker(s) will chose top questions to answer live at the end of the webinar. §  Please post your questions as we go along! §  Only post your question once; we’ll get to it as we go down the list. #forcewebinar
  • Recognize this scenario in life? Something happens #forcewebinar Call to action Someone or thing acts
  • Recognize this scenario in life? Leaky pipes #forcewebinar Call plumber Plumber fixes the pipes
  • Recognize this scenario in business? Event #forcewebinar Notification Workflow
  • Recognize this scenario in business? New Lead created #forcewebinar Salesperson gets alert Salesperson calls Lead and makes a sale
  • Optimal event notification design for business apps Know your … Requirements Options Use an option that meets your requirements #forcewebinar
  • Hot, Open Leads Scenario Requirements Implementation options §  Notify both online & offline users §  Workflow rule §  Notify users immediately §  Database trigger with email §  Log all alerts §  Respond to all alerts #forcewebinar §  Chatter feed with email
  • Stick around, here’s what you’ll learn … Requirements Approaches & implementation options Demos & source code #forcewebinar
  • Let’s get started … #forcewebinar
  • Know your requirements
  • Event importance can dictate requirements How important is an event? Critical Insignificant #forcewebinar
  • Event Notification Requirements: Importance Requirement Minimal Latency Accountability Response #forcewebinar Critical Yes Yes Yes Insignificant No No No
  • Event frequency can dictate requirements How often does an event occur? Frequent Infrequent #forcewebinar
  • Event Notification Requirements: Frequency Requirement Minimal Latency Accountability Response #forcewebinar Frequent No No No Infrequent Yes Yes Yes
  • Requirements graph example Determinant Determinant Requirement Immediate notification Critical Infrequent Log Mandatory response #forcewebinar
  • Requirements example Determinant Determinant Requirement Deferred notification Insignificant Frequent No log Optional response #forcewebinar
  • Requirements graph example Determinant Determinant Requirement Immediate notification Critical Frequent Log Optional response #forcewebinar
  • Know your requirements
  • Force.com event notification requirements Determinants Requirements •  Importance •  Frequency •  Latency •  Accountability •  Resolution #forcewebinar
  • Improv + Discovery = Satisfied Customers How improvistational theatre techniques can improve your discovery skills T.K. Horeis, salesforce.com, Cloud and Industry Architect @TKHoreis Steve Bobrowski, salesforce.com, @sbob909
  • Know your options
  • Force.com event notification approaches & options Dynamic Web pages #forcewebinar Near real-time messages Deferred messages
  • Force.com event notification approaches & options Dynamic Web pages #forcewebinar Near real-time messages Deferred messages
  • Dynamic, auto-refreshing Web page Characteristics §  Teams of users are online & watching §  Missed events tolerated §  Refreshes happen often §  Receipt of event notification not required Stock ticker #forcewebinar
  • Dynamic, auto-refreshing Web page Force.com implementation options Auto-refreshing … §  Visualforce page §  Report (browser plugin) §  List view (browser plugin) #forcewebinar
  • Force.com event notification approaches & options Dynamic Web pages #forcewebinar Near real-time messages Deferred messages
  • Near real-time messages Characteristics §  Users cannot always be online watching pages §  Near real-time notification §  Missed events not tolerable §  Proof of individual event notification required §  Relatively few events, low noise #forcewebinar Messages Events
  • Near real-time messages Force.com implementation options §  Workflow rule –  Email –  Outbound message Messages §  Chatter feed with email §  Chatter feed trigger Events #forcewebinar
  • Force.com event notification approaches & options Dynamic Web pages #forcewebinar Near real-time messages Deferred messages
  • Deferred messages Requirements §  Users cannot always be online watching pages §  Deferred (significantly) event notifications tolerated Message §  Missed events tolerable §  Receipt of individual event notification not required §  Data set is potentially large §  Potentially many events #forcewebinar Events
  • Deferred messages Force.com implementation options §  Scheduled reports Message Events #forcewebinar
  • Force.com event notification approaches & options Dynamic Web pages Near real-time messages Deferred messages •  Visualforce pages •  Reports •  List views •  Workflow rules •  Chatter feed email •  Chatter feed trigger •  Scheduled reports #forcewebinar
  • Enough theory …
  • Show me how!
  • Demos: Hot, Open Leads, every which way Workflow rule Dynamic Visualforce page Scheduled report #forcewebinar
  • Implementation 1: Dynamic Web page Visualforce page
  • The Observer Pattern: Push vs. Pull Update Lead push pull (polling) #forcewebinar
  • Implementation 1a: Polling with Apex actionPoller Visualforce page With <apex:actionPoller> #forcewebinar Controller (Apex) Force.com database
  • Implementation 1a: Page <apex:page showHeader=”true" controller=”leadListController" tabstyle="lead" sidebar="false">
 <apex:form >
 <apex:pageBlock >
 <apex:pageBlockTable id="leadList" value=”{!leads}" var="l">
 <apex:column headerValue="Name">
 <apex:outputLink value="/{!l.id}">{!l.Name}</apex:outputLink>
 </apex:column>
 <apex:column value="{!l.state}"/>
 <apex:column value="{!l.company}"/>
 <apex:column value="{!l.email}"/>
 </apex:pageBlockTable>
 <apex:actionPoller action=”{!pollAction}" reRender="leadList" interval="15"/>
 </apex:pageBlock>
 </apex:form>
 </apex:page> #forcewebinar
  • Implementation 1a: Controller public with sharing class leadListController {
 
 
 
 Transient Lead[] leads;
 String query = 'SELECT Id, Name, State, Company, Email, LastModifiedDate FROM Lead WHERE Status = 'Open - Not Contacted' AND Rating = 'Hot' ORDER BY LastModifiedDate DESC LIMIT 100';
 public Lead[] getLeads() {
 leads = Database.query(query);
 return leads;
 }
 public PageReference pollAction() {
 leads = Database.query(query);
 return null;
 } #forcewebinar
  • Traditional polling implementation: Pros & cons Pros Cons §  Easy §  Wasteful §  Partial page refresh §  Consumptive §  WHERE clause in query §  View state §  Transient controller variable §  No API calls #forcewebinar
  • Implementation 1b: Streaming API Push topic Force.com database #forcewebinar push Visualforce page “subscriber” to the push topic
  • Force.com Streaming API factoids §  Push on CREATE or UPDATE §  Push topic queries cannot: –  Use relationships (join data) –  Aggregate data (SUM, AVG, etc.) –  Reference formula fields –  Other limitations #forcewebinar
  • Implementation 1b: Streaming API Insert Update Delete Lead #forcewebinar trigger Push topic HOL__c Visualforce page “subscriber” to the push topic
  • Implementation 1b: Intermediary object #forcewebinar
  • Implementation 1b: Push topic PushTopic pushTopic = new PushTopic();
 pushTopic.Name = 'HOL';
 pushTopic.Query = 'SELECT Id, Name, Action__c, Lead_Name__c, Company__c, State__c, Email__c, Lead__c FROM Hot_Open_Lead__c'; 
 pushTopic.ApiVersion = 28.0;
 pushTopic.NotifyForOperations = 'All';
 pushTopic.NotifyForFields = 'Referenced';
 insert pushTopic; #forcewebinar
  • Implementation 1b: Controller @RemoteAction
 static public Lead[] getHotLeads() {
 String query = 'SELECT Id, Name, State, Company, Email, LastModifiedDate FROM Lead WHERE Status = 'Open - Not Contacted' AND Rating = 'Hot' ORDER BY LastModifiedDate DESC';
 Lead[] leads = Database.query(query);
 return leads;
 } #forcewebinar
  • Implementation 1b: Static Resources <apex:includeScript value="{!$Resource.cometd}"/>
 <apex:includeScript value="{!$Resource.jquery}"/>
 <apex:includeScript value="{!$Resource.json2}"/>
 <apex:includeScript value="{!$Resource.jquery_cometd}"/>
 <apex:includeScript value="{!URLFOR($Resource.jquery_ui,'/ jquery-ui-1.10.3/ui/jquery-ui.js')}"/>
 <apex:includeScript value="{!$Resource.underscore}"/> #forcewebinar
  • Implementation 1b: Load Initial Table var template = $("#holList").html();
 leadListController.getHotLeads(function(res,mes) {
 hotLeads = res;
 $("#leadTable").html(_.template(template,{items:hotLeads}));
 }); #forcewebinar
  • Implementation 1b: Script Template <tbody>
 <%
 %>
 <%
 %>
 </tbody> // repeat items 
 _.each(items,function(item){ 
 <tr id="lead-<%= item.Id %>" class="dataRow">
 <!-- use variables -->
 <td><a href="/<%= item.Id %>"><%= item.Name %></a></td>
 <td><%= item.State %></td>
 <td><%= item.Company %></td>
 <td><%= item.Email %></td> 
 </tr>
 });
 #forcewebinar
  • Implementation 1b: Respond to Streaming API // Connect to the CometD endpoint
 $.cometd.init({
 url: window.location.protocol+'//'+window.location.hostname+'/ cometd/24.0/',
 requestHeaders: { Authorization: 'OAuth {!$Api.Session_ID}'}
 });
 // Subscribe to the push topic
 $.cometd.subscribe('/topic/HOL', function(message) {
 updateHotLeads(message); 
 }); #forcewebinar
  • Live demo
  • Long polling implementation: Pros & cons Pros Cons §  Minimal page refreshes §  Requires some code §  Partial page refreshes §  Complex use cases require some thought §  No view state §  Easy on the database §  Centralized logic §  Overcomes Streaming API challenges #forcewebinar
  • Implementation 2: Near-real time messaging Workflow rule Messages Events
  • Live demo
  • Workflow rule: Pros & cons Pros Cons §  No code §  Could get noisy §  Near real-time messages §  Accountability (logs) #forcewebinar
  • Implementation 3: Deferred messaging Scheduled report Message Events
  • Live demo
  • Scheduled report: Pros & cons Pros Cons §  No code §  Lag time §  No noise §  Missed events §  Accountability (logs) #forcewebinar
  • Summary
  • Source code §  Github repo: http://bit.ly/1hR3aMw #forcewebinar
  • Article Access article link on developer.force.com/architect #forcewebinar
  • Even more stuff …
  • Architect Core Resources page developer.force.com/architect #forcewebinar
  • Q&A Steve Bobrowski Architect Evangelist @sbob909 #forcewebinar Josh Birk Developer Evangelist @JoshBirk