Advanced Salesforce Formula Date Fields

Calculate the First Day of the Previous Month (Created Date)

IF(    
     MONTH(DATEVALUE(CreatedDate))=1,     
     DATE(
          YEAR(DATEVALUE(CreatedDate))-1,
          MONTH(DATEVALUE(CreatedDate))-1,
          DAY(DATEVALUE(CreatedDate) - DAY(DATEVALUE(CreatedDate))+1)
     ),         
     DATE(
          YEAR(DATEVALUE(CreatedDate)),
          MONTH(DATEVALUE(CreatedDate))-1,
          DAY(DATEVALUE(CreatedDate) - DAY(DATEVALUE(CreatedDate))+1)
     )
)
 

Calculate the First Day of the Month

 DATE(YEAR(CloseDate),MONTH(CloseDate),1) 

 

Calculate the Last Day of the Month

DATE( 
YEAR(TODAY()), 
MONTH(TODAY()), 
CASE( MONTH(TODAY()), 
1, 31, 
2, IF( MOD( YEAR(TODAY()), 4) = 0, 29, 28), 
3, 31, 
4, 30, 
5, 31, 
6, 30, 
7, 31, 
8, 31, 
9, 30, 
10, 31, 
11, 30, 
12, 31, 


)
 
 
Calculate Weekdays (Number)

MOD( {!CloseDate} - DATE(1900, 1, 6), 7)


Calculate Weekdays (Text)

CASE(MOD( {!CloseDate} - DATE(1900, 1, 6), 7),
0, "Saturday",
1, "Sunday",
2,"Monday", 
3, "Tuesday", 
4, "Wednesday", 
5, "Thursday", 
6,"Friday","")

 

Lead Age (accounting for converted leads)

IF(IsConverted,ConvertedDate - DATEVALUE(CreatedDate), TODAY() - DATEVALUE(CreatedDate))

 

Contact Age

FLOOR((TODAY()-Birthdate)/365.2425)

 

Current Week Number

MOD(FLOOR( ( Expected_Launch_Date__c -DATEVALUE("2006-01-01" ))/7),52)+1

Creating Ownership with Custom Lookup Fields for Portal Users in Salesforce

Problem:

When creating views/reports in Salesforce- if you want to display records specific to the logged-in user- you can do so, but only based off of the standard Owner field.

When I was building out HubSpot's Partner Portal- we needed to create views and reports across various objects to show a partner their records. Nothing more, nothing less. It could be their customers, leads they've registered, cases they've logged, etc... The problem with this, however, is that we track partner 'Ownership' with a custom lookup field that points to that partner's Salesforce account. They don't actually own their records, and we cannot change that for internal reporting purposes.

Solution:

You may be thinking, "Can't you just create a view for each Partner User?" Well, yes, you can, and that may be fine at first, but what if you have 1,000 Partner Users? Do you really want to create 1,000 views for each object? No, you don't.

Good news! Every Partner's User Record in Salesforce has a lookup field on it that points to the associated Contact. The Contact (obviously) is associated with their corresponding Partner Account, and it is that Partner Account that is populated in our various lookup fields to denote partner ownership across Salesforce.  Because of this- we can hack something together to dynamically show a Portal User their Records with a single view!

Steps:

1.) On the User Object- Create a custom formula text field called 'Partner Portal Account ID'. Set the formula to: Contact.AccountId

This is simply going to return the Account ID for the Partner User's Contact.

2.) For each object you want to create a view for- add another custom formula text field called 'Logged in User is Portal User'. Set the formula to:

IF( AND(

Partner_Account__r.Id = $User.Partner_Portal_Account_ID__c, 

LEN(Partner_Account__r.Id) > 0), "Yes", "No")

This is also simple. What this does is say- if the current users 'Partner Portal Account ID' matches the ID of the Account in the Partner Account lookup field- return a Yes, otherwise, return a No.

3.) Make a view and add the filter 'Logged in User is Portal User' equals 'Yes'

Screen_shot_2012-03-10_at_3

That's it. You can use this on any object, and it works great in reports too.

You can now create dynamic views and reports in Salesforce to show record ownership based on a custom lookup field.

Enjoy!

David

 

Automated Surveying With Salesforce

If you work for, or do business with a company that values customer happiness and success, it's likely you either send and/or receive surveys asking for feedback.

At HubSpot, we're no different, and we do quite a bit of surveying to not only gauge customer happiness, but to also measure support performance and evaluate the success of various internal programs and initiatives.

With the numerous surveying tools available on the AppExchange, getting set up is relatively easy, but it's how you choose to map your results back to Salesforce that can really take your data to the next level.

Items to consider:

1.) Is the relationship between Salesforce record and survey(s) 1:1 or 1:Many?

This is important to consider for your data mapping / survey object relationship. If every record in Salesforce will receive no more than 1 survey, it may be enough to simply add fields on that object to capture all of your data. A typical case closed survey is a good example of this.

If the relationship is many surveys for a single Salesforce record, you'd be best served by creating a custom Survey Response object (or something similar) to capture your data. Sending quarterly customer satisfaction surveys is a good example of this. You can create a 'Customer Satisfaction Survey' object, where a new record will be created every time a survey is completed.

2.) Standard or Custom Objects?

While there are many Surveying tools on the AppExchange (many of which are free), not all of them integrate with custom objects in Salesforce. This is obviously important to consider when evaluating vendors.

Implementation:

If you can create Workflow Rules and Email Alerts, you can set up automated surveys. 

Most survey tools will automatically generate for you a URL specific to your survey. In most cases- you'll be able to append Salesforce fields to the URL to map to the correct record in Salesforce.com

Example: 

http://hubspot.force.com/caseclosed/TakeSurvey?id=zab70000002auSW&cId={!Contact.Id}&caId={!Case.Id} 

Once embedded in an Email Template- Salesforce will be smart enough to replace Contact.Id and Case.Id with the corresponding Record IDs, just as it does for normal merge fields. When someone then clicks on that link and fills out the survey- their response will get sucked back into Salesforce, as will their Contact and Case Id, which you can populate in a lookup field so you can do all sorts of reporting.

You can then set up a simple Workflow rule and Email alert as follows:

Screen_shot_2012-01-22_at_12

How do you survey your customer base?

Updated: Salesforce.com's History of Acquisitions and Investments

Since my original post 6 months ago, Salesforce has made two acquisitions and 6 investments. Here is an update:

EDIT: Updated to include Rypple Acquisition

Logos

Salesforce.com's History of Acquisitions and Investments

Company Location Date Cost Type
(A)cquisition
(I)nvestment
Category Notes
Sendia Santa Monica, CA USA April 2006 $15m A Mobile Now force.com mobile
Kieden San Francisco, CA August 2006   A Advertising Salesforce for Google AdWords
Kenlet   January 2007   A Support Now Salesforce Ideas / IdeaExchange
Koral San Mateo, CA USA March 2007   A Productivity / CMS Now Salesforce Content
Appirio San Mateo, CA USA March 2008   I Development SaaS solutions provider.
Instranet Chicago, IL USA August 2008 $31.5m A Productivity/Support Now Salesforce Knowledge
Practice Fusion San Francisco, CA USA August 2009   I Health Care Electronic Medical Records (EMR)
GroupSwim San Francisco, CA USA December 2009   A Social Media Now part of Chatter
Informavores Cardiff, UK December 2009   A Productivity Now Visual Process Manager
ServiceMax Santa Clara, CA USA April 2010   I Productivity Field service management software
Jigsaw San, Mateo CA USA April 2010 $142m A Productivity  
Sitemasher Vancouver, BC Canada June 2010   A Development Now Salesforce Sites - An interactive site builder.
Activa Live Chat St. Clair Shores, MI USA September 2010   A Support Live chat support software.
DocuSign Seattle, WA USA December 2010   I Productivity Online signature service.
Heroku San Francisco, CA USA December 2010 $212m A Development Cloud platform service provider for running and maintaining Ruby on Rails application.
Etacts Palo Alto, CA USA December 2010 $6-7m (not official) A Productivity Intelligent contact management / tracking. Integrates with Gmail and Mobile devices.
Assistly San Francisco, CA USA January 2011   I Support Help Desk / Ticket Management that integrates with Social Media channels.
Dimdim Boston, MA USA January 2011 $31m A Productivity Web conferencing
Seesmic San Francisco, CA USA February 2011   I Social Media Social Media app that lets you manage all of your accounts. Integrates with Chatter.
Manymoon San Francisco, CA USA February 2011 $25m A Productivity Social Productivity - Integrates with Google Apps
HubSpot Cambridge, MA USA March 2011   I Marketing Marketing software platform
Radian6 Fredericton, NB Canada March 2011 $326m A Social Media Social Media tracking/engagement platform
Kenady Redwood City, CA USA August 2011   I Productivity Cloud-based manufacturing management.
Assistly San Francisco, CA USA September 2011 $50m A Support Help Desk / Ticket Management that integrates with Social Media channels.
Infor Alpharetta, GA USA September 2011   I Software Enterprise finance/ERP/Manufacturing Software.
Box.net Palo Alto, CA USA October 2011   I Productivity Enterprise/Consumer Filesharing and Collaboration in the cloud.
Urban Airship Palo Alto, CA USA October 2011   I Mobile Mobile push-notifications, subscriptions
Model Metrics Chicago, IL USA November 2011 ? A CRM Consulting CRM Consulting/Services
Rypple Toronto, ON Canada December 2011 $65m A Productivity/HR Social performance management platform

Chart

18 Acquisitions for at least $904m
11 Investments

Anyone care to help me fill in the blanks?

This is How Google Voice Interpreted a Voicemail From Salesforce Support Today

Hey Baby, this is out here from Salesforce calling about the case number. To answer your question. Now if we change the sound of HI from developer to contact only 830 or you don't know if you do is any configuration our Medicaid does it feel to have it in your developer sandbox, which isn't a change the types so we can, please. The storage Give me a call.

I love you, Google Voice.