• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Developing Apex Triggers for Chatter
 

Developing Apex Triggers for Chatter

on

  • 487 views

Join us as we explore how to use simple Apex Triggers to make Chatter ever more useful. Specifically, you'll learn how to create Triggers to automatically post Opportunity Next Actions to a Chatter ...

Join us as we explore how to use simple Apex Triggers to make Chatter ever more useful. Specifically, you'll learn how to create Triggers to automatically post Opportunity Next Actions to a Chatter Group, automatically add new users to Chatter groups, and automatically follow and unfollow Salesforce items based on some criteria.

Statistics

Views

Total Views
487
Views on SlideShare
487
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

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

    Developing Apex Triggers for Chatter Developing Apex Triggers for Chatter Presentation Transcript

    • Developing Apex Triggers for Chatter Chad Smith, Senior Consultant Alternative Technology Solutions @chad_w_smith
    • 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 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.
    • Chad Smith Senior Consultant, Alternative Technology Solutions @chad_w_smith #SFChatterTrigger
    • Agenda ▪ Trigger Architecture • Single trigger per object • Utility Class for processing and DML operation ▪ Chatter Objects • FeedItem • EntitySubscription ▪ Example #1 – Auto-post to “Customer Win” Chatter Group ▪ Example #2 – Manager auto-follow “Big Deals” ▪ Example #3 – Auto-add new users to “Salesforce Q&A” Chatter Group
    • … before we begin ▪ Who is using Chatter now? ▪ Who is using trigger with Chatter? ▪ Who has written a trigger before?
    • Trigger Architecture ▪ Problems with multiple triggers on the same object • Cannot control order of execution • Organization of the org ▪ Solution Class Code • Single trigger per object • Processing and DML done within utility class Trigger Class Code DML Statement
    • FeedItem Object ▪ “FeedItem represents an entry in the feed, such as changes in a record feed, including text posts, link posts, and content posts.” ▪ Important Fields • Body (Textarea) – The text or ‘body’ of the post • ParentID (ID) – Chatter Group ID, AccountID, UserID (Profile Post) • Type (Picklist) – TextPost, LinkPost, PollPost ▪ http://www.salesforce. com/us/developer/docs/api/Content/sforce_api_objects_feeditem.htm
    • EntitySubscription Object ▪ “Represents a subscription for a user following a record or another user.” ▪ Important Fields • NetworkID (ID) – Community ID • ParentID (ID) – ID of the record being followed • SubscriberID (ID) – ID of the user following the record. ▪ Add Link to Docs
    • CollaborationGroupMember Object ▪ “Represents a member of a Chatter group.” ▪ Important Fields • CollaborationGroupID (ID) – Chatter Group ID • CollaborationRole (Picklist) – Admin or Standard • MemberID (ID) – UserID of the Member • NotificationFrequency (Picklist) – D for Daily, W for Weekly, N for Never, P for Post ▪ http://www.salesforce. com/us/developer/docs/api/Content/sforce_api_objects_collaborationgr oupmember.htm
    • Object Model
    • Example #1 – Auto-Post to “Customer Win” Chatter Group ▪ Post information to your “Customer Win” Chatter Group when your opportunity goes to “Closed Won” ▪ Celebrate Victories! ▪ Minimize Emails in favor of Chatter (Chatter Adoption) ▪ Other Ideas • Opportunity Next Action Group • Project Next Action Group ▪ Code Walk Through
    • Example #2 – Manager Auto-Follow for Big Deals ▪ Set manager of a user to follow any opportunity over $5,000. ▪ Code Walk Through
    • Example #3 – Add new users to the “Salesforce Q&A” Chatter Group ▪ Salesforce Chatter Group for Salesforce Questions & Answers ▪ Minimize support emails for your Administrator ▪ Drive Salesforce & Chatter Adoption
    • Deck & Code ▪ Dreamforce Session Chatter ▪ Alternative Technology Solutions Website • http://alttechsolutions.com/http://alttechsolutions.com/SFtrigger Email me! • csmith@alttechsolutions.com
    • Chad Smith Senior Consultant, Alternative Technology Solutions @chad_w_smith