• Home
  • About
    • Leadership
    • Partners
    • Blogroll
  • Force-Squared Blog
    • Tips and Tricks
    • Configuration
    • Development
  • Support
    • Knowledge Base
    • Submit a Case
  • Is It Dreamforce Yet?

X-Squared On Demand

Salesforce solutions delivered

  • Home
  • About
    • Leadership
    • Partners
    • Blogroll
  • Force-Squared Blog
    • Tips and Tricks
    • Configuration
    • Development
  • Support
    • Knowledge Base
    • Submit a Case
  • Is It Dreamforce Yet?
  • Tips and Tricks
  • Configuration
  • Development
You are here: Home / Archives for Apex

Prevent Duplicate Emails on Leads

January 3, 2024 by David Schach Leave a Comment

Because the original Salesforce Cookbooks are no longer available online, I’m putting this code here so other people can benefit from it. I’m pulling (and cleaning up a bit) from the 2010 Cookbook. Discover an effective solution for preventing duplicate leads in Salesforce with this comprehensive Apex code cookbook. Because the original Salesforce Cookbooks are […]

Filed Under: Apex, Salesforce CRM Tagged With: Apex

Chatter Publisher Actions (Part 2): Object Custom Action

July 15, 2013 by David Schach 12 Comments

In the previous post, we looked at using the standard (button-click) way to create a new child record using Publisher Actions. Pretty basic stuff. Using Visualforce to create a custom action is a bit harder. Let's start with the documentation. The PDF provided by clicking on the link in the Actions screen (Account action is […]

Filed Under: Apex, Chatter, Development, Summer 13, Tips and Tricks, Visualforce Tagged With: Apex, Chatter, Force.com Platform, Publisher, Visualforce

Create and Populate a Map Without Loops

July 25, 2012 by David Schach 7 Comments

There are many reasons to use Maps in Apex triggers. Sometimes I want to make a List of Contacts, but I want to pull each one by its ID. This is a good reason to abandon the List and to make a Map<Id, Contact>. (Some will prefer to use Map<String, Contact>, and that is okay […]

Filed Under: Apex, Tips and Tricks Tagged With: Apex, Force.com Platform

Workflow ISCHANGED() translated to Apex trigger

February 2, 2012 by David Schach 2 Comments

Workflow is great. I can simply and declaratively make changes, and can easily update things like email templates, criteria, tasks, etc. without using Eclipse and writing/running unit tests.Sometimes, however, workflow isn’t enough; we need to use a trigger. Today, I had a use-case that when a DateTime field is filled, a contact (identified via a […]

Filed Under: Apex, Configuration, Tips and Tricks Tagged With: Apex

Next Birthday Formula

July 6, 2011 by David Schach 4 Comments

How would you display your Contacts with upcoming birthdays? I’ve seen people use “Birthdays This Week,” “Birthdays This and Next Week,” and other reports to display the list. I’ve also seen requirements for showing a person’s next birthday, to trigger an automatic email to each Contact on his/her birthday. Let’s see how it’s done: Next, […]

Filed Under: Configuration, Salesforce Tagged With: Apex, Force.com Builder, Force.com Platform

PageReference Best Practice

May 5, 2011 by David Schach 2 Comments

I've seen a lot of coders put the following into their custom Visualforce controllers: I've decided that I don't like this approach. It feels too much like a URL hack, and though I'm sure that it will always work (meaning that salesforce.com will never change its way of referring to a record by /<recordID>), I'd […]

Filed Under: Apex, Development, Salesforce, Visualforce Tagged With: Apex

Chatter BINGO Released Into The Wild

March 25, 2011 by David Schach Leave a Comment

With Dreamforce 2010 behind us and Dreamforce 2011 fast approaching, the first ever crowdsourced conference application is publicly available! Chatter BINGO has been released as an unmanaged package, meaning that all the source code is open and ready for customizing to your hearts’ content. Chatter BINGO was conceived by Chris Shackelford and Brad Gross (@imperialstout) […]

Filed Under: Apex, Salesforce, Visualforce, X-Squared On Demand Tagged With: #df10, Apex, AppExchange, Just for fun, Visualforce, X-Squared On Demand

Activity Type Field – Do Not Use

March 21, 2011 by David Schach Leave a Comment

The field Event.Type (which is sort of the same as Task.Type) is a difficult field to use.  Here are a few reasons: Type cannot be the controlling field for a dependent picklist. On an Event list view (/007), even when specifying record type, the Type field cannot be edited. Salesforce requires you to select a […]

Filed Under: Apex, Salesforce, Tips and Tricks Tagged With: Apex

Visualforce Inline Editing – I’m In Love

February 28, 2011 by David Schach 4 Comments

I’m totally addicted to the new Visualforce inline editing feature. It all started with this post by Josh Birk at Developerforce. I liked it, but as a “standardstylesheets” specialist, I wanted a bit more. Then I looked at the Visualforce apex:inlineEditSupport documentation, and I was hooked. Okay, so you’re probably wondering why this is so […]

Filed Under: Development, Force.com Platform, New Features, Salesforce, Tips and Tricks, Visualforce Tagged With: Apex, New Features, Visualforce

System Replacement For isTest Apex Method

February 23, 2011 by David Schach 1 Comment

Sometimes we have to write code that executes differently if the Apex is being tested. For a great example, check out Scott Hemmeter's blog post on testing webservice callouts at http://sfdc.arrowpointe.com/2009/05/01/testing-http-callouts/. Scott's example works well, and he uses a Boolean isApexTest, running certain code if this is true or false. I used to do something […]

Filed Under: Apex, Development, Salesforce, Winter 11 Tagged With: Apex, New Features

  • 1
  • 2
  • 3
  • Next Page »

Is it Dreamforce Yet?

Find out!

Find us on the AppExchange

Mass Update Contacts 2.0

Get It Now

Recent Posts

  • Prevent Duplicate Emails on Leads
  • Duplicate Record Item Enrichment and Auto-Deletion Code
  • Lightning Component With Running User Information
  • ChatterBINGO is Now Open-Source
  • Display Only My Role’s Records on a Report

Post Categories

Popular Tags

#df09 #df10 Akismet Apex AppBuilder AppExchange Appirio Astadia Blogs Chatter Configuration Content DreamFactory Dreamforce Eclipse IDE Enterprise Force.com Builder Force.com Platform Google Infowelders Integration Just for fun Lightning New Developments New Features Partner Program PersonAccount Projects Publisher Salesforce Salesforce1 Salesforce for Google Apps sfdcverse Sites Visualforce Web-to X-Squared On Demand

Find Us Online

  • Twitter
  • Facebook
  • LinkedIn
  • RSS

Subscribe

RSS Feed Comments

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 164 other subscribers

Copyright © 2008–2025 X-Squared On Demand · Genesis Framework by StudioPress · WordPress · Log in

 

Loading Comments...