Thursday 29 January 2015

Dynamic Visualforce Components

Visualforce is primarily intended to be a static, markup-driven language that lets developers create a user interface that matches the Salesforce look-and-feel. However, there are occasions when it is necessary to programmatically create a page. Usually, this is to achieve complicated user interface behavior that is difficult or impossible with standard markup.

Dynamic Visualforce components offer a way to create Visualforce pages that vary the content or arrangement of the component tree according to a variety of states, such as a user’s permissions or actions, user or organization preferences, the data being displayed, and so on. Rather than using standard markup, dynamic Visualforce components are designed in Apex.

A dynamic Visualforce component is defined in Apex like this:

Component.Component_namespace.Component_name

For example, <apex:dataTable> becomes Component.Apex.DataTable.

The Standard Component Reference contains the dynamic representation for all valid Visualforce components.

Visualforce components that are dynamically represented in Apex behave like regular classes. Every attribute that exists on a standard Visualforce component is available as a property in the corresponding Apex representation with get and set methods. For example, you could manipulate the value attribute on an <apex:outputText> component as follows:

Component.Apex.OutputText outText = new Component.Apex.OutputText();

outText.value = 'Some dynamic output text.';

Consider using dynamic Visualforce components in the following scenarios:

You can use dynamic Visualforce components inside complex control logic to assemble components in combinations that would be challenging or impossible to create using equivalent standard Visualforce. For example, with standardVisualforce components, you typically control the visibility of components using the rendered attribute with the global IF() formula function. By writing your control logic in Apex, you can choose to display components dynamically with a more natural mechanism.

If you know that you’ll be iterating over objects with certain fields, but not specifically which objects, dynamic Visualforce components can “plug in” the object representation by using a generic sObject reference.


Dynamic Visualforce components are not intended to be the primary way to create new Visualforce pages in your organization. Existing Visualforce pages shouldn’t be rewritten in a dynamic manner and, for most use cases, standard Visualforce components are acceptable and preferred. You should only use dynamic Visualforce components when the page must adapt itself to user state or actions in ways that can’t be elegantly coded into static markup.


This tag acts as a placeholder for your dynamic Apex components. It has one required parameter—componentValue—which accepts the name of an Apex method that returns a dynamic component.

The following Visualforce components do not have dynamic Apex representations:

<apex:attribute>

<apex:component>

<apex:componentBody>

<apex:composition>

<apex:define>

<apex:dynamicComponent>

<apex:include>

<apex:insert>

<apex:param>

<apex:variable>

===========

Example

========

<apex:page controller="SimpleDynamicController">

<apex:dynamicComponent componentValue="{!dynamicDetail}" />

</apex:page>


/* Controller */

public class SimpleDynamicController {

public Component.Apex.Detail getDynamicDetail() {

Component.Apex.Detail detail = new Component.Apex.Detail();

detail.expressions.subject = '{!acct.OwnerId}';

detail.relatedList = false;

detail.title = false;

return detail;

}


// Just return the first Account, for example purposes only



public Account acct {

get { return [SELECT Id, Name, OwnerId FROM Account LIMIT 1]; }

}

}

Tuesday 27 January 2015

EXECUTING ANONYMOUS APEX INSIDE ECLIPSE

One of the most underutilized programming techniques in Force.com is the ability to execute a snippet of apex code "anonymously". I know, it has a funny ring to it. Anonymous code is basically just a block of code that doesn't get stored inside Salesforce.com. This is nice, because often times you just want to try part of a method out or execute a SOQL statement without going through the hassle of adding it to a trigger or a class.

This is a great technique to quickly evaluate or debug a statement of code on-the-fly. There are a couple of ways you can do this.


Open up the Developer Console inside Salesforce
The executeAnonymousWeb services API call
Inside Eclipse/Force.com IDE

I typically do this inside Eclipse so I thought I would quickly highlight how to do that and include a screenshot as a guide. When you have the Force.com IDE plugin installed in Eclipse, all you have to do is navigate to the Execute Anonymous tab. If you don't see the tab, make sure you've got the Force.com perspective open (opens by default when you create a new Force.com project).

Inside the tab, you'll see a dropdown for the active project, a log category dropdown (apex code, apex profiling, callout, database, validation, workflow) and a log level slider.

Below those settings, you'll see a "Source to execute" textbox. Here is where you will actually type your code snippet.

Now all you have to do is run it by clicking "Execute Anonymous". If there are any syntax errors, you'll see those below in the results window. If the code compiles, it will run and you'll see the output below. Don't get discouraged if the output looks a little verbose and hard to read. You can always adjust the slider over to the left and show less information.


Thursday 22 January 2015

Advanced Formula Fields in Salesforce

Use the following formula samples when creating custom formula fields. For samples of other types of formulas, see Examples of Validation Rules and Useful Default Field Value Formulas.

This document contains the following categories of custom formula samples:

Account Management

Account Rating

This formula evaluates Annual Revenue, Billing Country, and Type, and assigns a value of “Hot,” “Warm,” or “Cold.”

IF (AND (AnnualRevenue > 10000000,

CONTAINS (CASE (BillingCountry, "United States", "US", "America", "US", "USA", "US", "NA"), "US")),

IF(ISPICKVAL(Type, "Manufacturing Partner"), "Hot",

IF(OR (ISPICKVAL (Type, "Channel Partner/Reseller"),

ISPICKVAL(Type, "Installation Partner")), "Warm", "Cold")),

"Cold")

For details about using these functions, see IF, AND, CONTAINS, CASE, and ISPICKVAL.

In addition, you can reference this Account Rating formula field from the contact object using cross-object formulas.

Account.Account_Rating__c

Account Region

This formula returns a text value of “North,” “South,” “East,” “West,” or “Central” based on the Billing State/Province of the account.

IF(ISBLANK(BillingState), "None",

IF(CONTAINS("AK:AZ:CA:HA:NV:NM:OR:UT:WA", BillingState), "West",

IF(CONTAINS("CO:ID:MT:KS:OK:TX:WY", BillingState), "Central",

IF(CONTAINS("CT:ME:MA:NH:NY:PA:RI:VT", BillingState), "East",

IF(CONTAINS("AL:AR:DC:DE:FL:GA:KY:LA:MD:MS:NC:NJ:SC:TN:VA:WV", BillingState), "South",

IF(CONTAINS("IL:IN:IA:MI:MN:MO:NE:ND:OH:SD:WI", BillingState), "North", "Other"))))))

For details about using these functions, see IF, LEN, and CONTAINS.

Contract Aging

This formula calculates the number of days since a contract with an account was activated. If the contract Status is not “Activated,” this field is blank.

IF(ISPICKVAL(Contract_Status__c, "Activated"),

NOW() - Contract_Activated_Date__c, null)

For details about using these functions, see IF, ISPICKVAL, and NOW.

Contract Approval Process Aging

This formula calculates how many days a contract is in the approval process. This example is a number formula field on contracts that uses a custom date field called Date in approval.

TODAY()-Date_in_approval__c

For details about using this function, see TODAY.

Month of Last Account Activity

This formula field displays the month of the last account activity or “None” if there are no activities for the account.

CASE(MONTH(LastActivityDate),

1, "January",

2, "February",

3, "March",

4, "April",

5, "May",

6, "June",

7, "July",

8, "August",

9, "September",

10, "October",

11, "November",

12, "December",

"None")

For details about using these functions, see CASE and MONTH.

Month of Service-Level Agreement Expiration

This formula returns the month that your service-level agreement expires. This example uses a custom date field called SLA Expiration Date.

MONTH(SLAExpirationDate__c)

For details about using this function, see MONTH.

Account Media Service Links

BBC™ News Search

This formula creates a link to a BBC news search site based on the Account Name.

HYPERLINK(

"http://newssearch.bbc.co.uk/cgi-bin/search/results.pl?scope=newsifs;tab=news;q="&Name,

"BBC News")

Bloomberg™ News Search

This formula creates a link to an account's ticker symbol on the Bloomberg website.

HYPERLINK(

"http://www.bloomberg.com/apps/quote?ticker="&TickerSymbol,

"Bloomberg News")


CNN™ News Search

This formula creates a link to a CNN news search site using the Account Name.


HYPERLINK(

"http://websearch.cnn.com/search/search?source=cnn&

invocationType=search%2Ftop&sites=web&query="&Name,

"CNN News")


MarketWatch™ Search


This formula creates a link to an account's ticker symbol on the Marketwatch.com website.

HYPERLINK(

"http://www.marketwatch.com/tools/quotes/quotes.asp?symb="&TickerSymbol,

"Marketwatch")


Google™ Search

This formula creates a link to a Google search site using the Account Name.


HYPERLINK(

"http://www.google.com/search?en&q="&Name,

"Google")

Google News Search

This formula creates a link to a Google news search site using the Account Name

HYPERLINK(

"http://www.google.com/news?en&q="&Name,

"Google News")

Yahoo!™ Search

This formula creates a link to a Yahoo! search site using the Account Name.

HYPERLINK(

"http://search.yahoo.com/search?p="&Name,

"Yahoo Search")

Yahoo! News Search

This formula creates a link to a Yahoo! news search site using the Account Name.

HYPERLINK(

"http://news.search.yahoo.com/search/news?p="&Name,

"Yahoo News")

For details about using the function used in these formulas, see HYPERLINK.

Case Management


Autodial

This formula creates a linkable phone number field that automatically dials the phone number when clicked. In this example, replace "servername" and "call" with the name of your dialing tool and the command it uses to dial. The merge field, Id, inserts the identifier for the contact, lead, or account record. The first Phone merge field tells the dialing tool what number to call and the last Phone merge field uses the value of the Phone field as the linkable text the user clicks to dial.

HYPERLINK("http://servername/call?id="

& Id & "&phone=" & Phone, Phone)

For details about using this function, see HYPERLINK.

Case Aging (Assignments)

Use this example of a custom formula field called Days Open to display different text depending on the number of days a case has been open:

CASE(Days_Open__c, 3,

"Reassign", 2, "Assign Task", "Maintain")

The following text is displayed:

§ “Reassign” for any case open three days.

§ “Assign Task” for any case open two days.

§ “Maintain” for all other cases.

For details about using this function, see CASE.

Case Aging (Open Cases)

This formula calculates the number of days a case has been open. If the case is closed, it sets the result to null. Add this formula to a related list as the sort column to quickly see which open cases have been open the longest. The formula returns zero if the case has been open for less than 24 hours.

IF(IsClosed,

null,

NOW() - CreatedDate )

For details about using these functions, see IF and NOW.

Case Aging (Open and Closed Cases)

This formula calculates the number of days a closed case was open or the number of days an open case has been open since the date the case was created. The formula returns zero if the case has been open for less than 24 hours.

IF(IsClosed,

ROUND(ClosedDate - CreatedDate, 0), ROUND((NOW() - CreatedDate),0))

For details about using these functions, see IF, ROUND, and NOW.

Case Categorization

This formula displays a text value of “RED,” “YELLOW,” or “GREEN,” depending on the value of a case age custom text field.

IF(DaysOpen__c > 20, "RED",

IF(DaysOpen__c > 10, "YELLOW",

"GREEN") )

For details about using this function, see IF.

Case Data Completeness Tracking

This formula calculates the percentage of specific custom fields that contain data. The formula checks the values of two custom number fields: Problem Num and Severity Num. If the fields are empty, the formula returns the value “0.” The formula returns a value of “1” for each field that contains a value and multiplies this total by fifty to give you the percentage of fields that contain data.

(IF(ISBLANK(Problem_Num__c), 0, 1) + IF(ISBLANK(Severity_Num__c ), 0,1)) * 50

For details about using these functions, see IF and ISBLANK.

Case Due Date Calculation

This formula sets the due date of a case based on the priority. If it is high, the due date is two days after it opens. If it is medium, the due date is five days after opening. Otherwise, the due date is seven days.

CASE (Priority,

"High", CreatedDate + 2,

"Medium",CreatedDate + 5,

CreatedDate + 7)

For details about using this function, see CASE.

Suggested Agent Prompts

This formula prompts an agent with cross-sell offers based on past purchases.

CASE(Product_Purch__c,

"Printer", "Extra toner cartridges", "Camera", "Memory cards",

"Special of the day")

For details about using this function, see CASE.

Suggested Offers

This formula suggests a product based on the support history for a computer reseller. When the Problem custom field matches a field, the formula field returns a suggestion.

CASE(Problem__c,

"Memory", "Suggest new memory cards", "Hard Drive failure", "Suggest new hard drive with tape backup",

"")

For details about using this function, see CASE.

Commission Calculations

Commission Amounts for Opportunities

The following is a simple formula where commission is based on a flat 2% of the opportunity Amount.

IF(ISPICKVAL(StageName, "Closed Won"),

ROUND(Amount *0.02, 2), 0)

This example calculates the commission amount for any opportunity that has a “Closed Won” stage. The value of this field will be the amount times 0.02 for any closed/won opportunity. Open or lost opportunities will have a zero commission value.

For details about using these functions, see IF, ISPICKVAL, and ROUND.

Commission Deal Size

This formula calculates a commission rate based on deal size, returning a 9% commission rate for deals over 100,000 and an 8% commission rate for smaller deals.

IF(Amount > 100000, 0.09, 0.08 )

For details about using this function, see IF.

Commission Greater Than or Equal To

This formula assigns the “YES” value to opportunities with a commission greater than or equal to one million. Note, this is a text formula field on opportunities that uses a custom currency field called Commission

IF(Commission__c >= 1000000, "YES", "NO")

For details about using this function, see IF.

Commission Maximum

This formula determines what commission to log for an asset based on which is greater: the user's commission percentage of the price, the price times the discount percent stored for the account or 100 dollars. This example assumes you have two custom percent fields on users and assets.

MAX($User.Commission_Percent__c * Price,

​Price * Account_Discount__c, 100)

For details about using this function, see MAX.

Contact Management

Contact's Account Creation Date

This date formula displays the account's Created Date field on the contacts page.

Account.CreatedDate

Contact's Account Discount Percent

This percent formula displays the account's Discount Percent field on the contacts page.

Account.Discount_Percent__c

Contact's Account Name

This formula displays the standard Account Name field on the contacts page.

Account.Name

Contact's Account Phone

This formula displays the standard Account Phone field on the contacts page.

Account.Phone

Contact's Account Rating

Use this formula to display the Account Rating field on the contacts page.

CASE(Account.Rating, "Hot", "Hot", "Warm", "Warm", "Cold", "Cold", "Not Rated")

For details about using this function, see CASE.

Contact's Account Website

This formula displays the standard Account Website field on the contacts page.

Account.Website

If the account website URL is long, use the HYPERLINK function to display a label such as “Click Here” instead of the URL. For example:

IF(Account.Website="", "",

IF(

OR(LEFT(Account.Website, 7) = "http://",LEFT(Account.Website, 8) = "https://"),

HYPERLINK( Account.Website , "Click Here" ),

HYPERLINK( "http://" & Account.Website , "Click Here" )

)

)

This formula also adds the necessary "http://" or "https://" before a URL if neither were included in the URL field.

For details about using this function, see HYPERLINK.

Contact’s Age

Use this formula to calculate a person’s age based on a standard field called Birthdate. The person’s Birthdate is subtracted from today’s date, which returns the number of days since the person’s Birthdate. This number is divided by the number of days in a year and rounded down to the nearest integer.

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

For details about using these functions, see FLOOR and TODAY.

Contact's Birthday

This formula displays the value “Yes” if the contact’s birthday falls in the current calendar month

IF (

MONTH( Birthdate) = MONTH( TODAY()), "Yes", "")

For details about using these functions, see IF, MONTH, and TODAY.

Contact's LinkedIn™ Profile

You can configure a link that appears on your contacts' profile page that sends you to their LinkedIn profile. To do so:




1. Click SetupCustomizeContactsButtons and Links.

2. Click New under Custom Buttons and Links

3. Enter a Label for this link, like LinkedInLink.

4. Enter this formula in the content box:




http://www.linkedin.com/search/fpsearch?type=people&keywords={!Contact.FirstName}+{!Contact.LastName}

5. Click Save.







Contact Identification Numbering

This formula displays the first five characters of the contact’s last name and the last four characters of the contact’s social security number separated by a dash. Note that this example uses a text custom field called SSN on contacts.

TRIM(LEFT(LastName,

5)) & "-" & TRIM(RIGHT(SSN__c, 4))

For details about using these functions, see TRIM, LEFT, and RIGHT.

Contact Preferred Phone

This formula displays the contact’s preferred contact method in a contact related list—work phone, home phone, or mobile phone—based on a selected option in a Preferred Phone custom picklist.

CASE(Preferred_Phone__c,

"Work", "w. " & Phone,

"Home", "h. " & HomePhone,

"Mobile", "m. " & MobilePhone,

"No Preferred Phone")

For details about using this function, see CASE.

Contact Priority

This formula assesses the importance of a contact based on the account rating and the contact's title. If the account rating is Hot or the title starts with Executive, then the priority is high (P1). If the account rating is Warm or the title starts withVP then the priority is medium (P2), and if the account rating is Cold then the priority is low (P3).

IF(OR(ISPICKVAL(Account.Rating, "Hot"), CONTAINS(Title, "Executive")), "P1",

IF(OR(ISPICKVAL(Account.Rating, "Warm"), CONTAINS(Title, "VP")), "P2",

IF(ISPICKVAL(Account.Rating, "Cold"), "P3",

"P3")

)

)

Contact Yahoo! ID

This formula displays a clickable Yahoo! Messenger icon indicating if the person is logged on to the service. Users can click the icon to launch a Yahoo! Messenger conversation with the person. This example uses a custom text field calledYahoo Name on contacts where you can store the contact's Yahoo! Messenger ID.

HYPERLINK("ymsgr:sendIM?"

& Yahoo_Name__c, IMAGE("http://opi.yahoo.com/online?u=" &

Yahoo_Name__c & "&m;=g&t;=0", "Yahoo"))

For details about using these functions, see HYPERLINK and IMAGE.

Dynamic Address Formatting

This formula field displays a formatted mailing address for a contact in standard format, including spaces and line breaks where appropriate depending on the country for the account.

CASE(ShippingCountry,

"USA",

ShippingStreet & BR() &

ShippingCity & ",

" & ShippingState & " " &

ShippingPostalCode & BR()

& ShippingCountry,

"France",

ShippingStreet & BR() &

ShippingPostalCode & " " &

ShippingCity & BR() &

ShippingCountry, "etc")

For details about using this function, see CASE and BR.

Telephone Country Code

This formula determines the telephone country code of a contact based on the Mailing Country of the mailing address.

CASE(MailingCountry,

"USA", "1",

"Canada", "1",

"France", "33",

"UK", "44",

"Australia", "61",

"Japan", "81",

"?")

For details about using this function, see CASE.

Unformatted Phone Number

This formula removes the parentheses and dash characters from North American phone numbers. This is necessary for some auto-dialer software.

IF(Country_Code__c = "1", MID( Phone ,2, 3) & MID(Phone,7,3) & MID(Phone,11,4), Phone)

For details about using these functions, see IF and MID.

Data Categorization

Deal Size Large and Small

This formula displays “Large Deal” for deals over one million dollars or “Small Deal” for deals under one million dollars.

IF(Sales_Price__c > 1000000,

"Large Deal",

"Small Deal")

For details about using this function, see IF.

Deal Size Small

This formula displays “Small” if the price and quantity are less than one. This field is blank if the asset has a price or quantity greater than one.

IF(AND(Price<1,Quantity<1),"Small",

null)

For details about using these functions, see IF and AND.

Product Categorization

This formula checks the content of a custom text field named Product_Type and returns “Parts” for any product with the word “part” in it. Otherwise, it returns “Service.” Note that the values are case sensitive, so if a Product_Type field contains the text “Part” or “PART,” this formula returns “Services.”

IF(CONTAINS(Product_Type__c, "part"), "Parts", "Service")

For details about using these functions, see IF and CONTAINS.

Date Calculations

Birthday in Current Year Accounting for Leap Years

This formula returns the date of a person's birthday in the current year, even if the person's birthday is on February 29th in a leap year.




IF(AND(MONTH(Birthdate) = 2, DAY(Birthdate) = 29),

(IF(OR(MOD(YEAR(DATEVALUE(NOW())), 400) = 0, AND(MOD(YEAR(DATEVALUE(NOW())) ,4) = 0, MOD(YEAR(DATEVALUE(NOW())), 100) <> 0)),

DATE(YEAR(DATEVALUE(NOW())), MONTH(Birthdate), DAY(Birthdate)),

DATE(YEAR(DATEVALUE(NOW())), MONTH(Birthdate + 1), 28))),

(DATE(YEAR(DATEVALUE(NOW())), MONTH(Birthdate) , DAY(Birthdate))))




Day of Week (number)

This formula calculates today’s day of the week as a number (0 = Sunday, 1 = Monday, 2 = Tuesday, and so on).

MOD(TODAY() - DATE(1900, 1, 7), 7)

Similarly, this formula substitutes the TODAY() function shown in the previous example with a custom date field called Sign Up Date. It returns the day of the week as a number for that field.

MOD(Sign_Up_Date__c - DATE(1900, 1, 7), 7)

For details about using these functions, see MOD, TODAY, and DATE.

Day of Week (text)

This formula calculates today’s day of the week and displays it as text. To determine the day of the week for a date field, use the formula below and replace “TODAY()” with that date field.

CASE(

MOD(TODAY() - DATE(1900, 1, 7), 7),

0, "Sunday",

1, "Monday",

2, "Tuesday",

3, "Wednesday",

4, "Thursday",

5, "Friday",

6, "Saturday", "Error")

For details about using these functions, see CASE, MOD, TODAY, and DATE.

Day of Year

This formula calculates today’s numeric day of the year (a number between 1 and 365).

TODAY() – DATE(YEAR(TODAY()), 1, 1) + 1

For details about using these functions, see TODAY, DATE, and YEAR.

Days Until End of Month

This formula displays the number of days between a specific date and the end of the month in which the date occurs.

IF(

MONTH(CloseDate)=12,

DATE(YEAR(CloseDate),12,31) - CloseDate,

DATE(YEAR(CloseDate),

MONTH(CloseDate)+1,1) - CloseDate-1)

For details about using these functions, see IF, MONTH, DATE, and YEAR.

Time of Day

This formula returns the time of day in Greenwich Mean Time (GMT), for example: “20:04 PM”).

MID (TEXT (Due_Date_Time__c), 12, 5)

For details about using these functions, see MID and TEXT.

Discounting

Maintenance and Services Discount

This formula field uses two custom currency fields: Maintenance Amount and Services Amount. It displays “Discounted” on an opportunity if its maintenance amount and services amount do not equal the opportunity Amount standard field value. Otherwise, it displays "Full Price."

IF(Maintenance_Amount__c + Services_Amount__c <> Amount,

"Discounted",

"Full Price")

For details about using this function, see IF.

Opportunity Discount Amount

This formula calculates the difference of the opportunity Amount less the Discount Amount. Note that Discount Amount is a custom currency field on opportunities.

Amount

- Discount_Amount__c

For details about using this operator, see - (Subtract).

Opportunity Discount Rounded

Use this formula to calculate the discounted amount of an opportunity rounded off to two digits. This example is a number formula field on opportunities that uses a custom percent field called Discount Percent.

ROUND(Amount-Amount* Discount_Percent__c,2)

For details about using this function, see ROUND.

Opportunity Discount with Approval

This formula adds a “Discount Approved” checkbox to an opportunity. It uses conditional logic to check the value of the approval flag before calculating the commission.

IF(Discount_Approved__c, ROUND(Amount – Amount * DiscountPercent__c, 2), Amount)

For details about using these functions, see IF and ROUND.

Employee Services

Bonus Calculation

This example determines an employee's bonus amount based on the smallest of two amounts: the employee's gross times bonus percent or an equally divided amount of the company's performance amount among all employees. It assumes you have custom number field for Number of Employees, a custom percent field for Bonus Percent, and currency custom fields for the employee's Gross and company's Performance.

MIN(Gross__c * Bonus_Percent__c, ​

Performance__c / Number_of_Employees__c)

For details about using this function, see MIN.

Employee 401K

This example formula determines which amount to provide in employee 401K matching based on a matching program of half of the employee's contribution or $250, whichever is less. It assumes you have custom currency field forContribution.

MIN(250, Contribution__c /2)

For details about using this function, see MIN.

Hours Worked Per Week

This formula uses a custom tab to enable time tracking of hours worked per day. It uses a formula field to sum the hours per week.

MonHours__c + TuesHours__c + WedsHours__c + ThursHours__c + FriHours__c

For details about using this operator, see + (Add).

Total Pay Amount

This formula determines total pay by calculating regular hours multiplied by a regular pay rate, plus overtime hours multiplied by an overtime pay rate.

Total Pay =

IF(Total_Hours__c <= 40, Total_Hours__c * Hourly_Rate__c,

40 * Hourly_Rate__c +

(Total_Hours__c - 40) * Overtime_Rate__c)

For details about using this function, see IF.

Expense Tracking

Expense Identifier

This formula displays the text “Expense-” followed by trip name and the expense number. This is a text formula field that uses an expense number custom field.

"Expense-"

& Trip_Name__c & "-" & ExpenseNum__c

For details about using this operator, see - (Subtract).

Mileage Calculation

This formula calculates mileage expenses for visiting a customer site at 35 cents a mile.

Miles_Driven__c * 0.35

For details about using this operator, see * (Multiply).

Financial Calculations

Compound Interest

This formula calculates the interest, you will have after T years, compounded M times per year.

Principal__c * ( 1 + Rate__c / M ) ^ ( T * M) )

For details about using these operators, see * (Multiply), / (Divide), and ^ (Exponentiation).

Compound Interest Continuous

This formula calculates the interest that will have accumulated after T years, if continuously compounded.

Principal__c * EXP(Rate__c * T)

For details about using this function, see EXP.

Consultant Cost

This formula calculates the number of consulting days times 1200 given that this formula field is a currency data type and consulting charges a rate of $1200 per day. Note that Consulting Days is a custom field on opportunities.

Consulting_Days__c

* 1200

For details about using this operator, see * (Multiply).

Gross Margin

This formula provides a simple calculation of gross margin. In this formula example, Total Sales and Cost of Goods Sold are custom currency fields.

Total_Sales__c - Cost_of_Goods_Sold__c

For details about using this operator, see - (Subtract).

Gross Margin Percent

This formula calculates the gross margin based on a margin percent

Margin_percent__c * Items_Sold__c * Price_item__c

For details about using this operator, see * (Multiply).

Payment Due Indicator

This formula returns the date five days after the contract start date whenever Payment Due Date is blank. Payment Due Date is a custom date field on contracts.

(BLANKVALUE(Payment_Due_Date__c, StartDate

+5)

For details about using this function, see BLANKVALUE.

Payment Status

This formula determines if the payment due date is past and the payment status is “UNPAID.” If so, it returns the text “PAYMENT OVERDUE” and if not, it leaves the field blank. This example uses a custom date field called Payment Due Dateand a text custom field called Payment Status on contracts.

IF(

AND(Payment_Due_Date__c < TODAY(),

ISPICKVAL(Payment_Status__c, "UNPAID")),

"PAYMENT OVERDUE",

null )

For details about using these functions, see IF, AND, TODAY, and ISPICKVAL.

Image Links

Yahoo! Instant Messenger™ Image

This formula displays an image that indicates whether a contact or user is currently logged in to Yahoo! Instant Messenger. Clicking the image launches the Yahoo! Instant Messenger window. This formula uses a custom text field called Yahoo Name to store the contact or user’s Yahoo! ID.

IF(ISBLANK(Yahoo_Name__c),"", HYPERLINK("ymsgr:sendIM?" & Yahoo_Name__c,

IMAGE("http://opi.yahoo.com/online?u=" & Yahoo_Name__c & "&m=g&t=0", " ")))

For details about using these functions, see IF, LEN, HYPERLINK, and IMAGE.

“Skype Me™” Auto Dialer Button

This formula displays an image that looks like a push button. Clicking the button automatically dials the specified phone number.

HYPERLINK("callto://" & "+1" & Phone,

IMAGE("http://goodies.skype.com/graphics/skypeme_btn_small_blue.gif",

"Click to Skype"))

For details about using these functions, see HYPERLINK and IMAGE.

Flags for Case Priority

This formula displays a green, yellow, or red flag image to indicate case priority.

IMAGE(

CASE( Priority,

"Low", "/img/samples/flag_green.gif",

"Medium", "/img/samples/flag_yellow.gif",

"High", "/img/samples/flag_red.gif",

"/s.gif"),

"Priority Flag")

For details about using this function, see IMAGE.

Color Squares for Case Age

This formula displays a 30 x 30 pixel image of a red, yellow, or green, depending on the value of a Case Age custom text field.

IF( Case_Age__c > 20,

IMAGE("/img/samples/color_red.gif", "red", 30, 30),

IF( Case_Age__c > 10,

IMAGE("/img/samples/color_yellow.gif", "yellow", 30, 30),

IMAGE("/img/samples/color_green.gif", "green", 30, 30),

))

For details about using these functions, see IF and IMAGE.

Traffic Lights for Status

This formula displays a green, yellow, or red traffic light images to indicate status, using a custom picklist field called Project Status. Use this formula in list views and reports to create a “Status Summary” dashboard view.

IMAGE(

CASE(Project_Status__c,

"Green", "/img/samples/light_green.gif",

"Yellow", "/img/samples/light_yellow.gif",

"Red", "/img/samples/light_red.gif",

"/s.gif"),

"status color")

For details about using these functions, see IMAGE and CASE.

Stars for Ratings

This formula displays a set of one to five stars to indicate a rating or score.

IMAGE(

CASE(Rating__c,

"1", "/img/samples/stars_100.gif",

"2", "/img/samples/stars_200.gif",

"3", "/img/samples/stars_300.gif",

"4", "/img/samples/stars_400.gif",

"5", "/img/samples/stars_500.gif",

"/img/samples/stars_000.gif"),

"rating")




For details about using these functions, see IMAGE and CASE.

Consumer Reports™-Style Colored Circles for Ratings

This formula displays a colored circle to indicate a rating on a scale of one to five, where solid red is one, half red is two, black outline is three, half black is four, and solid black is five.

IMAGE(

CASE(Rating__c,

"1", "/img/samples/rating1.gif",

"2", "/img/samples/rating2.gif",

"3", "/img/samples/rating3.gif",

"4", "/img/samples/rating4.gif",

"5", "/img/samples/rating5.gif",

"/s.gif"),

"rating")

For details about using these functions, see IMAGE and CASE.

Horizontal Bars to Indicate Scoring

This formula displays a horizontal color bar (green on a white background) of a length that is proportional to a numeric score. In this example, the maximum length of the bar is 200 pixels.

IMAGE("/img/samples/color_green.gif", "green", 15, Industry_Score__c * 2) &

IMAGE("/s.gif", "white", 15,

200 - (Industry_Score__c * 2))

For details about using this function, see IMAGE.

Integration Links

Application API Link

This formula creates a link to an application outside Salesforce, passing the parameters so that it can connect to Salesforce via the Web services API and create the necessary event.

HYPERLINK ("https://www.myintegration.com?sId=" & GETSESSIONID() & "?&rowID=" & Name & "action=CreateTask","Create a Meeting Request")

For details about using these functions, see HYPERLINK and GETSESSIONID.

Shipment Tracking Integration

This formula creates a link to FedEx, UPS, or DHL shipment tracking websites, depending on the value of a Shipping Method custom picklist field. Note that the parameters shown in this example for FedEx, UPS, and DHL websites are illustrative and do not represent the correct parameters for all situations.

CASE(Shipping_Method__c,

"Fedex",

HYPERLINK("http://www.fedex.com/Tracking?ascend_header=1&clienttype

=dotcom&cntry_code=us&language=english&tracknumbers= "& tracking_id__c,"Track"),

"UPS",

HYPERLINK("http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion

=5.0&sort_by=status&loc=en_US&InquiryNumber1= "& tracking_id__c & "&track.x=32&track.y=7", "Track") ,

"DHL",

HYPERLINK("http://track.dhl-usa.com/TrackByNbr.asp?ShipmentNumber=" & tracking_id__c,"Track"), "")




For details about using these functions, see CASE and HYPERLINK.

Skype Auto Dialer Integration

This formula creates a linkable phone number field that automatically dials the phone number via the Skype VOIP phone application. It requires installation of the Skype application (a third-party product not provided by salesforce.com) on your desktop.

HYPERLINK("callto://+" & Country_Code__c & Phone_Unformatted__c, Phone)

For details about using this function, see HYPERLINK.

Lead Management

Lead Aging (for open leads)

This formula checks to see if a lead is open and if so, calculates the number of days it has been open by subtracting the date and time created from the current date and time. The result is the number of days open rounded to zero decimal places. If the lead is not open, this field is blank.

IF(ISPICKVAL(Status,

"Open"), ROUND(NOW()-CreatedDate, 0), null)

For details about using these functions, see IF, ISPICKVAL, ROUND, and NOW.

Lead Data Completeness

This formula calculates the percent of certain lead fields that your sales personnel enter. The formula field checks the values of two custom number fields: Phone and Email. If the fields are empty, the formula returns the value “0.” The formula returns a value of “1” for each field that contains a value and multiplies this total by fifty to give you the percentage of fields that contain data.

(IF(Phone = "", 0, 1) + IF(Email = "", 0, 1) ) * 50

For details about using this function, see IF.

Lead Numbering

This formula returns a number value for the text value in the auto-number field Lead Number. This can be useful if you want to use the Lead Number field in a calculation, such as round-robin or other routing purposes. Note that auto-number fields are text fields and must be converted to a number for numeric calculations.

VALUE(Lead_Number__c)

For details about using this function, see VALUE.

Round Robin Assignment of Cases or Leads

The following formula example for leads assumes you have three lead queues and you want to assign an equal number of incoming leads to each queue. You can also assign cases using a similar formula.

MOD(VALUE(Lead_Number__c),

3)

Metrics

Temperature Conversion

This formula converts Celsius degrees to Fahrenheit.

1.8 * degrees_celsius__c + 32

For details about using these operators, see * (Multiply) and + (Add).

Unit of Measure Conversion

This formula converts kilometers to miles.

Miles__c/.621371192

For details about using this operator, see / (Divide).

Opportunity Management

Days Left to Close

This formula returns the expected number of days left to the close date of an opportunity.

Expected_close_date__c -TODAY()




For details about using this function, see TODAY.

Display Close Month for Reporting Purposes

This formula returns the month in text for the close date of an opportunity. Use this example when building a custom report that groups opportunities by the month of the Close Date.

CASE(

MONTH(CloseDate),

1, "January",

2, "February",

3, "March",

4, "April",

5, "May",

6, "June",

7, "July",

8, "August",

9, "September",

10, "October",

11, "November",

12, "December",

"Invalid month")

For details about using these functions, see CASE and MONTH.

Expected Product Revenue

This formula calculates total revenue from multiple products, each with a different probability of closing.

ProductA_probability__c * ProductA_revenue__c + ProductB_probability__c * ProductB_revenue__c

For details about using these operators, see * (Multiply) and + (Add).

Maintenance Calculation

This formula calculates maintenance fees as 20% of license fees per year. Maintenance Years is a custom field on opportunities.

Amount * Maint_Years__c * 0.2

For details about using this operator, see * (Multiply).

Monthly Subscription-Based Calculated Amounts

This formula calculates an opportunity amount based on a monthly subscription rate multiplied by the subscription period.

Monthly_Amount__c * Subscription_Months__c

For details about using this operator, see * (Multiply).

Monthly Value

This formula divides total yearly value by 12 months.

Total_value__c / 12

For details about using this operator, see / (Divide).

Opportunity Additional Costs

This formula calculates the sum of the opportunity Amount, maintenance amount, and services fees. Note that Maint amount and Service Fees are custom currency fields on opportunities.

Amount

+ Maint_Amount__c + Services_Amount__c

For details about using this operator, see + (Add).

Opportunity Categorization

This formula uses conditional logic to populate an Opportunity category text field, based on the value of the Amount standard field. Opportunities with amounts less than $1500 are “Category 1,” those between $1500 and $10000 are “Category 2,” and the rest are “Category 3.” This example uses nested IF statements.

IF(Amount < 1500, "Category 1", IF(Amount > 10000, "Category 3", "Category 2"))

For details about using this function, see IF.

Opportunity Data Completeness

This formula takes a group of opportunity fields and calculates what percent of them are being used by your sales personnel. This formula field checks five fields to see if they are blank. If so, a zero is counted for that field. A “1” is counted for any field that contains a value and this total is divided by five (the number of fields evaluated). Note that this formula requires you select the Treat blank fields as blanks option under Blank Field Handling while the Advanced Formula subtab is showing.

(IF(ISBLANK(Maint_Amount__c), 0, 1) + ​

IF(ISBLANK(Services_Amount__c), 0,1) + ​

IF(ISBLANK(Discount_Percent__c), 0, 1) + ​

IF(ISBLANK(Amount), 0, 1) +​

IF(ISBLANK(Timeline__c), 0, 1)) / 5

For details about using this function, see ISBLANK.

Opportunity Expected License Revenue

This formula calculates expected revenue for licenses based on probability of closing.

Expected_rev_licenses__c * Probability

For details about using this operator, see * (Multiply).

Opportunity Reminder Date

This formula creates reminder date based on seven days before the close date of an opportunity. Use this formula field in a workflow rule to create an event for the appropriate user to take action.

Reminder Date = CloseDate - 7

For details about using these operators, see = and == (Equal) and - (Subtract).

Opportunity Revenue Text Display

This formula returns the expected revenue amount of an opportunity in text format without a dollar sign. For example, if the Expected Revenue of a campaign is “$200,000,” this formula field displays “200000.”

TEXT(ExpectedRevenue)

For details about using this function, see TEXT.

Opportunity Split Credit for Sales Representatives

This formula splits opportunity amount between multiple sales representatives. The total reps custom field indicates the total number of representatives on the deal.

Amount / total_reps__c

For details about using this operator, see / (Divide).

Opportunity Total Deal Size

This formula calculates the sum of maintenance and services amounts.

Amount + Maint_Amount__c + Services_Amount__c

For details about using this operator, see + (Add).

Opportunity Total Price Based on Units

This formula generates proposal pricing based on unit price and total volume.

Unit_price__c * Volume__c * 20

For details about using this operator, see * (Multiply).

Professional Services Calculation

This formula estimates professional service fees at an average loaded rate of $1200 per day. Consulting Days is a custom field on opportunities.

Consulting_Days__c * 1200

For details about using this operator, see * (Multiply).

Stage-Based Sales Document Selection

This formula Identifies a relevant document in the Documents tab based on opportunity Stage. Use document IDs in the form of “00l30000000j7AO.”

CASE(StageName,

"Prospecting", "Insert 1st Document ID",

"Qualification", "Insert 2nd Document ID",

"Needs Analysis", "Insert 3rd Document ID",

"Value Proposition", …

)

)

For details about using this function, see CASE.

Sales Coach

This formula creates a hyperlink that opens a stage-specific document stored in the Documents tab. It uses the previously defined custom formula field that identifies a document based on opportunity Stage. See Stage-Based Sales Document Selection.

HYPERLINK("/servlet/servlet.FileDownload?file=" & Relevant_Document__c, "View Document in New Window")

For details about using this function, see HYPERLINK.

Shipping Cost by Weight

This formula calculates postal charges based on weight.

package_weight__c * cost_lb__c

For details about using this operator, see * (Multiply).

Shipping Cost Percentage

This formula calculates shipping cost as a fraction of total amount.

Ship_cost__c / total_amount__c

For details about using this operator, see / (Divide).

Tiered Commission Rates

This formula calculates the 2% commission amount of an opportunity that has a probability of 100%. All other opportunities will have a commission value of zero.

IF(Probability = 1,

ROUND(Amount * 0.02, 2),

0)

For details about using these functions, see IF and ROUND.

Total Contract Value from Recurring and Non-Recurring Revenue

This formula calculates both recurring and non-recurring revenue streams over the lifetime of a contract.

Non_Recurring_Revenue__c + Contract_Length_Months__c * Recurring_Revenue__c

For details about using these operators, see + (Add) and * (Multiply).

Pricing

Total Amount

This formula calculates a total amount based on unit pricing and total units.

Unit_price__c * Total_units__c

For details about using this operator, see * (Multiply).

User Pricing

This formula calculates a price per user license.

Total_license_rev__c / Number_user_licenses__c

For details about using this operator, see / (Divide).

Project Management

Calculate Intermediate Milestone from End Date

This formula calculates intermediate milestone dates by subtracting days from the end date (for projects that are planned based on end date).

Release_Date__c - 7 * Phase_duration_in_weeks__c

For details about using this operator, see * (Multiply).

Scoring Calculations

Lead Scoring

This formula scores leads, providing a higher score for phone calls than website requests.

CASE(LeadSource, "Phone", 2, "Web", 1, 0)

Here's a formula that scores a lead based on his or her rating:

CASE(1, IF(ISPICKVAL​(Rating, "Hot"),​ 1, 0), 3,​​ IF(ISPICKVAL​(Rating, "Warm"),​ 1, 0), 2, IF(ISPICKVAL​(Rating, "Cold"),​ 1, 0), 1))

For details about using this function, see CASE.

Customer Success Scoring

This formula uses a simple scoring algorithm to rank customers a high score for positive survey results in Salesforce.

Survey_Question_1__c * 5 + Survey_Question_2__c *2

For details about using these operators, see* (Multiply) and + (Add).

story 56: In the Footsteps of a Killer

From 1976 to 1986, one of the most violent serial criminals in American history

terrorized communities throughout California. He was little known, never caught, and

might still be out there. The author, along with several others, can’t stop working on

the case.

Michelle McNamara | Los Angeles | Feb 2013

--

MISSING LINKS

On a sleepless night last July—one of dozens I’ve powered through during the months I’ve

spent tracking him down—I Googled a description of a pair of cuff links he stole in the midst of a

home invasion in Stockton in September 1977. At that time the Golden State Killer, as I’ve

recently come to call him, hadn’t yet graduated to murder. He was a serial rapist who was

attacking women in their bedrooms from Sacramento to San Ramon, targeting those who lived

in quiet upper-middle-class suburban neighborhoods. He was young—anywhere from 18 to

30—Caucasian, and athletic, capable of eluding capture by jumping roofs and vaulting tall

fences. He frequently wore a ski mask. He had either blue or hazel eyes and, some victims

reported, a high-pitched voice. He would rant to his victims about needing money, but he

frequently ignored cash, even when it was right in front of him.

But he didn’t leave empty-handed. He took items of personal value from those he had violated:

engraved wedding bands, driver’s licenses, souvenir coins. The cuff links he stole in Stockton

were a slightly unusual 1950s style and monogrammed with the first initial N. From my research

I knew that boys’ names beginning with this letter were rare, appearing only once in the top 100

names of the 1930s and ’40s, when the original owner was likely born. The cuff links were a

family heirloom belonging to the victim’s husband; they were distinct looking.

I hit the return key on my laptop, expecting nothing. Then a jolt of recognition: There they were,

a single image out of the hundreds loading on my laptop screen, the same style as sketched out

in the police file I had acquired, with the same initial. They were going for $8 at a vintage store

in a small town in Oregon. I bought them immediately, paying $40 for overnight delivery, and

went to wake my husband.

“I think I found him,” I said, a little punchy from lack of sleep. My husband, a professional

comedian, didn’t have to ask who “him” was. While we live in Los Feliz with our young daughter,

my online life has been taken over by unsolved murders—and with maybe someday solving one

of them—on a Web site I launched in 2006 called True Crime Diary. By day I’m a 42-year-old

stay-at-home mom with a sensible haircut and Goldfish crackers lining my purse. In the evening,

however, I’m something of a DIY detective. I delve into cold cases by scouring the Internet for

any digital crumbs authorities may have overlooked, then share my theories with the 8,000 or so

mystery buffs who visit my blog regularly. When my family goes to sleep, I start clicking,

combing through digitized phone books, school yearbooks, and Google Earth views of crime

scenes: a bottomless pit of potential leads for the laptop investigator who now exists in the

virtual world.

The Golden State Killer, though, has consumed me the most. In addition to 50 sexual assaults

in Northern California, he was responsible for ten sadistic murders in Southern California. Here

was a case that spanned a decade and ultimately changed DNA law in the state. Neither the

Zodiac Killer, who terrorized San Francisco in the late 1960s and early ’70s, nor the Night

Stalker, who had Southern Californians locking their windows in the ’80s, was as active. Yet the

Golden State Killer has little recognition; he didn’t even have a catchy name until I coined one.

His capture was too low to detect on any law enforcement agency’s list of priorities. If this

coldest of cases is to be cracked, it may well be due to the work of citizen sleuths like me (and a

handful of homicide detectives) who analyze and theorize, hoping to unearth that one clue that

turns all the dead ends into a trail—the one detail that will bring us face-to-face with the

psychopath who has occupied so many of our waking hours and our dreams.

THE M.O.

On October 1, 1979, on Queen Ann Lane in Goleta, a town near Santa Barbara, a terrified

woman lay facedown in her living room, her wrists tied behind her back, her feet bound at the

ankles. Her tennis shorts had been thrown over her head as a blindfold. She could hear him

rummaging around in the kitchen. It was 2:20 a.m.

“I’ll kill ’em, I’ll kill ’em, I’ll kill ’em,” he chanted to himself—like, as an investigator would later put

it, “a guy pumping himself up for an athletic endeavor.”

The woman managed to remove the bindings from her feet and escaped screaming out the front

door; in the chaos her live-in boyfriend, bound in the bedroom, was able to hop into the

backyard and roll behind an orange tree, just missing the frantic, searching beam of the

intruder’s flashlight. A witness caught a glimpse of the suspect fleeing the scene: a lean man in

a Pendleton shirt pedaling furiously away on a stolen silver Nishiki ten-speed.

After that botched attack, none of his victims would survive to describe him. Almost three

months later, on the morning of December 30, a half mile south of where the October attack

took place, Santa Barbara sheriff’s detectives responded to a call at the condominium of Dr.

Robert Offerman. A woman out front was crying. “There are two people dead inside,” she said.

The bodies were in the bedroom. Offerman’s girlfriend, psychologist Debra Alexandria Manning,

35, lay on the right side of the waterbed, nude and bound. Offerman, a 44-year-old osteopath,

was on his knees on the floor; in his left hand he clutched a length of white three-strand nylon

cord. The killer’s plan seemed to have gone awry. Offerman had been able to break free from

his bindings, raising the possibility that the killer might have ordered Manning to tie him up and

that she had bound him loosely on purpose.

As detectives processed the crime scene, they stepped around a turkey carcass wrapped in

cellophane that had been discarded on the patio. At some point, probably before he shot his

victims through the heart and the back of the head, the killer had opened the refrigerator and

helped himself to Offerman’s leftover Christmas dinner.

The forensics team noted what appeared to be the intruder’s signatures: the nylon twine, the pry

marks on the doors and windows, the tennis shoe impressions. Everything matched the pattern

of a man who had become known as the East Area Rapist, or EAR, a cat burglar whose middle-

of-the-night assaults paralyzed Sacramento and Contra Costa counties starting in 1976 and

ending after a thwarted attack on July 6, 1979. To zero in on a victim he often entered the home

beforehand when no one was there, learning the layout, studying family pictures, and

memorizing names. Victims received hang-up or disturbing phone calls before and after they

were attacked. He disabled porch lights and unlocked windows. He emptied bullets from guns.

He hid shoelaces or rope under cushions to use as ligatures. These maneuvers gave him a

crucial advantage because when you woke from a deep sleep to the blinding flashlight and ski-

masked presence, he was always a stranger to you, but you were not to him.

The Northern California detectives on the EAR Task Force had theorized he would snake his

way south. They worried he was escalating in violence. “That’s him, I know it,” thought Contra

Costa investigator Larry Crompton when he learned of the Goleta murders. The Santa Barbara

County sheriff’s office felt differently and was reluctant to make the connection, whether out of

disbelief or fear of bad publicity.

Three months after the Goleta murders, in March 1980, there was another double murder, this

time in Ventura, of Charlene and Lyman Smith. Keith and Patrice Harrington, who were living in

a gated community in Dana Point, were the next victims. Then came Manuela Witthuhn in

Irvine. The scenes echoed each other: The females were all slender beauties whose hands

were bound behind their backs, and circling each single-story house were tiny star impressions

from a pair of size 9 Adidas. The rapist had evolved into a serial killer, and the transformation

only seemed to hone his self-discipline. Murder seemed to satiate him more than rape did, and

longer periods of time passed between the crimes. Whereas before he seemed to bask in the

notoriety, now he took pains to hide any hint of a link between the murders, removing ligatures

from the scene, even staging one murder to look like a robbery.

By May 5, 1986, when 18-year-old Janelle Cruz was discovered raped and bludgeoned in her

home in Irvine, only the killer and a few alert investigators like Crompton knew that the East

Area Rapist was now the worst unidentified violent serial offender in modern American history.

After Cruz’s murder, the Golden State Killer stopped. Perhaps his impulses had subsided.

Perhaps, like everyone else in America, he’d followed the August 1985 capture of Richard

Ramirez, the Satan worshipper known as the Night Stalker, and the case building up against

this psychopath who, like himself, had bound, raped, and killed his way (13 murders in all)

across California. The name this unknown perpetrator was given by law enforcement—the

Original Night Stalker, or ONS—was derived from the nom de crime of Ramirez. And Crompton

found himself among an ever-dwindling cadre of detectives pushing against a growing

indifference, dedicating himself to a case that, for all practical purposes, had been abandoned.

MALIGNANT OBSESSION

The woman who sits across from me in a small office in east Sacramento is a stranger. But you

wouldn’t have known that from the conversational shorthand we use from the moment we meet,

our message board equivalent of Klingon.

“Dog beating robbery in ’74?” I ask.

The woman, I’ll call her the Social Worker, reties her thick ponytail and takes a sip from a can of

Rockstar. She’s in her late fifties, with large, penetrating green eyes and a smoky voice. She

had greeted me in the parking lot by waving her arms wildly overhead. I liked her right away.

“I don’t believe it’s related,” she says.

The ’74 robbery in Rancho Cordova we’re parsing was the kind of recently uncovered incident

that the two of us had connected through on the serial killer message board. There is only one

book about this killer, and it’s what sparked my interest in the case when I read it two years ago.

Sudden Terror was self-published in 2010 by the now-retired detective Larry Crompton. But I

was familiar with such details as the robbery—and thousands of others—because of the A&E

Cold Case Files message board. Yes, the basic-cable channel behind addictive reality-TV

series like Intervention and Hoarders hosts a board for the true-crime reenactment series that

was canceled in 2006 (and that I’ve never actually watched) and lives on as a hidden hive of

digital crime solving. After reading Crompton’s book one night, I Googled “East Area Rapist” and

“Original Night Stalker” to see what else was out there about him, and the board popped up. I

started off as a lurker, an outsider gleaning the insights of others who were obsessed. Before I

knew it, I had read all of the 20,000 posts about the Golden State Killer (known as EAR/ONS on

the site), spending hours there while my daughter was taking a nap and after my husband went

to bed. Given that serial killers are the subjects of a half dozen prime-time shows currently on

television, I am obviously not alone.

I found a spectrum of personality types on the message board, from paranoid cranks to the raw,

curious insomniacs driven by the same compulsion to piece together the puzzle as I am. Of the

dozens of people who regularly visited, a devoted few stood out. The Social Worker (like many

on the board, she prefers anonymity) operates as a kind of gatekeeper between Sacramento

investigators and the board. This irks some posters, who accuse her of hinting at confidential

information and then shutting down when asked to share. That she occasionally has new

information is not in dispute. A few months after I began corresponding with her in April 2011,

the Social Worker posted a drawing of a decal she said was seen on a suspicious vehicle near

the scene of one of the Sacramento rapes. “It is possibly from a naval base on North Island,”

she posted, “but unconfirmed and has no record. Is it familiar to anyone on the board? Hoping

we may find where it is from.”

Now, a year after I first e-mailed the Social Worker, she is giving me a tour of the killer’s early

stalking grounds. She navigates from the passenger side as I steer my rental car around the

modest ranch houses abutting Sacramento’s old Mather Air Force Base, where he was active in

the mid-1970s (it has since been converted into one of the city’s airports). She points out a

nearby duplex where he raped victim number 24, a 17-year-old girl whose boyfriend was tied to

the bed facedown, a metal lid and salt shaker placed on his back. If the items fell off, the rapist

had threatened, he would come back and shoot him in the head.

Afterward the Social Worker guides me through the leafy neighborhoods of Arden-Arcade and

Del Dayo, which the rapist also turned into crime scenes. These areas of east Sacramento he

preyed on were not built for excitement. I counted an entire block of unbroken beige. The

tamped-down cautiousness belies the terrible things that happened here. We turn onto Malaga

Way, where on August 29, 1976, the clanging of her wind chimes and the strong smell of

aftershave awakened a 12-year-old girl. A masked man stood at her bedroom window, prying

away the upper left corner of the screen with a knife.

“I lived here through the height of it,” the Social Worker says. She was a young mom then and

recalls how the terror reached a debilitating peak around rape number 15. An uneasy memory

from that period had nagged at her, and she reached out to a detective with the Sacramento

Sheriff’s Department to see whether it was all in her mind. It wasn’t. The detective confirmed

that before the rapist’s penchant for phoning victims had been publicized, the Social Worker had

filed three police reports about an obscene caller, a “stalker” who, she said, “knew everything

about me.” She now believes the caller was him.

“It’s a really dark place, thinking about this stuff,” she says while we’re parked on the side of a

roundabout, the American River flashing blue in the distance. The Social Worker confides that

she felt “spiritually” called upon to help solve the case. “But I’ve learned you’ve got to watch out,

to take care of yourself. Or it can consume you.”

Can? Haven’t we spent the last four hours—to say nothing of the last few years—consumed? In

the car we swapped leads we’ve pursued. Already I’d dedicated an entire afternoon to tracking

down every detail I could about a member of the 1972 Rio Americano High School water polo

team, because in the yearbook photo he appeared lean and to have big calves, maybe the

same big calves that the Golden State Killer’s earlier victims had identified. The Social Worker

once dined with someone she regarded as a potential suspect and then bagged his water bottle

to test his DNA.

My own obsession with unsolved murders began on the evening of August 1, 1984, when a

neighbor of mine in Oak Park, Illinois, where I grew up, was found murdered. We knew Kathleen

Lombardo’s family from our parish church. She was out for a jog when she was dragged into an

alley. Neighbors reported seeing a man in a yellow tank top and headband watching Kathleen

intently as she jogged. He cut her throat.

Several days after the killing, without telling anyone, I walked the block and a half north from our

house to the spot where Kathleen had been attacked. I was 14, a cheerleader in Tretorn

sneakers whose crime experience began and ended with Nancy Drew. On the ground I saw

pieces of Kathleen’s shattered Walkman. I picked them up. Kathleen Lombardo’s murderer was

never caught.

What gripped me that summer before I started high school wasn’t fear or titillation but the

specter of that question mark where the killer’s face should be. When you commit murder and

remain anonymous, your identity is a wound that lingers on the victim, the neighborhood, and in

the worst cases, a nation. For digital sleuths, a killer who remains a question mark holds more

menace than a Charles Manson or a Richard Ramirez. However twisted the grins of those

killers, however wild the eyes, we can at least stare solidly at them, knowing that evil has a

shape and an expression and can be locked behind bars. Until we put a face on a psychopath

like the Golden State Killer, he will continue to hold sway over us—he will remain a powerful

cipher who triumphs by being just out of reach.

WHAT'S IN A NAME?

One of the uncomfortable truths about tracking and catching serial killers is, marketing matters.

Ever since Jack the Ripper terrorized the slums of 19th-century London, serial killers who thrive

on public reaction seem to instinctively know this and sometimes devise their own monikers.

The Zodiac Killer, for instance, announced himself in a letter to the editor in the San Francisco

Examiner in 1969. David Berkowitz, the Yonkers, New York, postal clerk who murdered six

people in their cars at random, came up with his tabloid sobriquet, Son of Sam, in a letter to the

New York Police Department, claiming a dog by that name had urged him to kill. Cousins

Kenneth Bianchi and Angelo Buono, together known as the Hillside Strangler, chillingly

described where they disposed of bodies and the method in which they dispatched ten young

women around northeast Los Angeles over a four-month period in the late ’70s. Most recently

L.A. Weekly crime writer Christine Pelisek used the name Grim Sleeper to describe a man who

is believed to be responsible for at least ten murders in South L.A., starting in 1985 with a 13-

year break between the final two murders. (A suspect has been arrested, and his list of victims

is far from settled.)

A handle that perfectly crystallizes the creepiness, menace, and horror of the perpetrator and

what he or she has done can’t help but captivate the public’s imagination. A grisly pathological

signature left at crime scenes will have the same effect. Either will put added pressure on

politicians and police departments to apprehend the killer as long as he remains at large, even if

he retires from murder and mayhem. And it will linger with the popular culture long after the

perpetrator has been caught, with tales retold in best-selling books and feature films. But he

benefited from not having a name people knew.

The moniker law enforcement bestowed on the Golden State Killer—EAR/ONS—was an

unwieldy and forgettable attempt to merge two identities. Sacramento police came up with “East

Area Rapist” because the early sexual assaults began in the eastern parts of the city. During a

meeting in the late ’90s of several Southern California law enforcement agencies, Larry Pool, an

investigator with the Orange County Sheriff’s Department, and other authorities would realize

that this man’s m.o. predated that of Ramirez. The unidentified serial killer they sought was the

“Original Night Stalker,” a name that stuck by default, much to Pool’s chagrin. When in 2001,

DNA tests showed that the East Area Rapist and the Original Night Stalker were the same

person, the killer became EAR/ONS for short.

Google “Son of Sam” and you’ll get more than a million hits. On Amazon you can take your pick

of eight books about Berkowitz. By comparison, a Google search of EAR/ONS yields barely

more than 11,000 mentions, and one of the top hits on Amazon is Jean Campbell’s Getting

Started Stringing Beads, which happens to contain a mention of clip-on earrings. On the same

page is Crompton’s sole text on the killer, which I’ve found to be an unvarnished, unfiltered

avalanche of case details, full of 1970s political incorrectness and strangely moving in its

depiction of one matter-of-fact cop’s rueful regret.

I came up with the name “Golden State Killer” for this article because his numerous crimes

spanned California, confounding authorities throughout several jurisdictions. Also, at the very

least, this ID is more memorable.

I’ve studied the Golden State Killer’s face, drawn from composite sketches made decades ago,

more than my own husband’s. There is no single accurate rendering of him, but a few

features—his lantern jaw and prominent nose—are consistent. His hair, hanging over his ears to

his collar, seems so ’70s that I can almost hear Lynyrd Skynyrd’s “What’s Your Name.” I know

his blood type (A positive, nonsecretor). I know his penis size (conspicuously small). I know that

he was built like a runner or a swimmer.

He liked to “bomb” a neighborhood, as one investigator put it, sometimes targeting houses just

yards from one another. He was nervous and fidgety yet brazen. Once, he walked away from a

crime scene without his pants on, and when a dog chased him into a backyard, he waited

patiently until he was sure the dog wouldn’t bite and then reentered the house. He paused in the

middle of one rape to go to the kitchen and eat apple pie. Sometimes after he violated

someone, the bound, blindfolded victim would later recall hearing him in another room of the

house, sobbing. Once, a victim remembered hearing him cry out over and over again: Mummy.

Mummy. Mummy. Another woman said he told her that news reports of his crimes “scares my

mommy.”

He relished keeping his victims off balance well after the initial attack. He issued incriminating

taunts (“I’ll kill you like I did some people in Bakersfield”) and allegedly sent a typewritten poem

titled “Excitement’s Crave” to Sacramento news outlets, comparing himself to Jesse James and

Son of Sam. He harassed his victims by phone. One brief, whispery threat was recorded by

authorities through a tapped phone line: “I’m going to kill you.”

A COLD CASE HEATS UP

After 48 hours of anticipation, I received the package containing the cuff links. I ripped open the

box, tore through the bubble wrap, and examined the sealed Ziploc bag with the cuff links

inside. I suddenly felt anxious. If a speck of biological evidence clung to these shiny gold pieces,

I risked destroying what might be key evidence with one fingerprint. I didn’t open the bag.

The best thing to do, I knew, was to turn the cuff links over to an authority on the killer. I already

had an interview set up with Larry Pool, the Orange County sheriff’s detective who was widely

recognized as the “face of the case.” I decided if I felt the interview was going well, I’d hand over

the plastic bag with the cuff links.

The problem was, of the handful of officials who remained focused on the Golden State Killer,

Pool intimidated me the most. He’d been described as “inaccessible” and “a little remote.” I

knew he’d been working on the case for the past 15 years. He’d been instrumental, along with

Golden State victim Keith Harrington’s attorney brother, Bruce, in getting Proposition 69

passed—the DNA Fingerprint, Unsolved Crime and Innocence Protection Act, which in 2004

established an all-felon DNA database in California. Thanks to their efforts, the California

Department of Justice now has the second-largest working DNA data bank in the country.

Pool and Bruce Harrington felt that by expanding the DNA database they’d surely net Golden

State. The disappointment, it was suggested to me, was sharp. I imagined Pool as a steely,

impassive cop locked away in a dimly lit room, the walls plastered with composites of the killer.

Instead a pleasant, somewhat formal 51-year-old man in wire-rim glasses and a red-checkered

shirt greets me in the small lobby of the FBI’s Orange County Regional Computer Forensics

Laboratory (Pool is still the Orange County Sheriff’s Department’s case agent for the killer but

works in computer forensics now). We sit across from each other at a long table inside a glass-

paneled conference room. He is the duty officer for the lab today, and when colleagues

occasionally poke their heads in, he responds with a clipped “copy that.”

I find him to be a thoughtful, measured speaker, the kind of person whose stoic exterior masks a

certain generosity and a belief that hours spent listening—even to a civilian crime

enthusiast—may be time well spent. “When I took this on, I was still relatively fresh, if you will,”

says Pool. “I got excited about people, like a ski-mask rapist in prison who matched the

description. In the first year, five or six times I got really excited. In the second year, four or five

times.” But now, after investigating, by his count, 8,000 suspects and spending years of

performing triage on urgent tips from fellow police and a public who are convinced their suspect

is the Original Night Stalker, Pool’s attitude is muted and deliberate. When he comes across a

particularly promising suspect, his curt response is always “Gotta eliminate him.”

Even the composite sketch that hangs above Pool’s desk is matter-of-fact: It shows the suspect

in a ski mask. “Is it of any value?” Pool says. “No. But we know he looked like that.” A new FBI

profile is being generated, he tells me, and it will diverge from earlier theories about the killer.

Pool’s theories have similarly evolved. In part from talking to criminal profilers who “understand

how these people are wired better than I do,” Pool no longer views the Golden State Killer as a

sort of superhero villain, a ballsy egomaniacal force in peak physical condition. “He’s a small

guy, diminished, and he does everything he can to get the upper hand at the beginning and to

keep it,” he says. “To intimidate and terrorize people because he doesn’t want to confront them

physically.”

The new FBI profile is part of the investigation’s reboot. In addition, Pool tells me the FBI has

provided its assessment on some crucial issues. The agency agrees with what many of the task

force investigators have long contended—that the suspect likely got his start two years earlier

and 200 miles farther south than was first believed, in Visalia, a farming town in the Central

Valley. Beginning in April 1974, Visalia experienced an unusual series of ransackings in four

residential neighborhoods. The Visalia Ransacker preferred personal effects like piggy banks,

photographs, and wedding rings, leaving behind more valuable items.

Then on September 11, 1975, the 16-year-old daughter of Claude Snelling, a journalism

professor at College of the Sequoias, was awakened by a man’s hand covering her nose and

mouth. “You’re coming with me. Don’t scream or I’ll stab you,” the ski-masked intruder

whispered. He led her out the back door. Snelling, alerted by the noise, ran onto the patio. “Hey,

what are you doing?” he shouted. “Where are you taking my daughter?”

The intruder didn’t reply. He raised a .38-caliber handgun and shot Snelling in the chest,

mortally wounding him, and then kicked the daughter three times in the face before running

away. He was a white male, about five feet ten, with “angry” eyes, the daughter reported to

police.

A stolen gun strongly pointed to the Visalia Ransacker. On December 10 detective Bill

McGowen startled the Ransacker outside a house he’d targeted three times before, and a

chase ensued. When McGowen fired a warning shot, the ski-masked suspect raised his hands

in surrender.

“Hey, OK, don’t hurt me,” he said in a squeaky voice, reaching with one hand to peel off his

mask. But it was a mime trick; with his other hand he fired a shot at McGowen. The bullet

shattered McGowen’s flashlight, sending shards into his eyes. The Ransacker jumped a fence

and escaped. The plundering in Visalia stopped. Months later the East Area Rapist attacks in

Sacramento began.

Pool tells me the FBI ran an actuarial study and concluded last year that there’s an 85 percent

chance the Golden State Killer is still alive.

I peg Pool as someone who prioritizes procedure and would accuse me of overstepping with my

impulsive cuff links purchase. But I take a chance at the end of our conversation and reach into

my backpack for the Ziploc bag. I nudge the cuff links across the conference table. He takes the

bag and examines it carefully.

“For me?” he asks, stone faced.

“Yes,” I say and begin to explain why I bought them.

I catch the slightest hint of a smile. “You’ve made me very happy,” he says. “In fact, I think I love

you.”

A few days later Pool ascertains that the cuff links are not the same pair after all. But it doesn’t

matter, as he has a more promising lead, one in which he needs the public’s help. It turns out

that having such a far-reaching, complicated case has its rewards: The many jurisdictions

means there are multiple property rooms to go back to in search of old evidence, to dig through

for clues stored years ago and forgotten.

That’s exactly what Paul Holes, the chief of the Contra Costa Crime Lab who helped develop

the DNA profile, was looking for in his property room, and he found it in a sealed bag marked

“collected at railroad tracks”—a clue overlooked and ignored. After all, it was a parking ticket

that eventually revealed Berkowitz was the Son of Sam.

In his office Pool taps at his computer keyboard, calling up an image that can’t load fast enough.

It shocks me how quickly I lean in, primed to memorize everything I see. I realize how hungry I

am for new information about the bogeyman who’s wormed his way into every corridor of my

brain.

A faded, hand-drawn map pops up on the screen. Hand drawn, the police believe, by the

Golden State Killer.

BACK TO THE BOARD

One of the more compelling online sleuths I’ve met through the message board is a 30-year-old

guy from South Florida whom I call the Kid. He has a bachelor’s degree in multimedia studies

and, he’s hinted, a somewhat troubled home life. He holds what he vaguely describes as “a

McJob,” but the message board is a full-time endeavor. Details matter to him. He’s smart,

meticulous, and occasionally brusque. He’s also, in my opinion, the case’s greatest amateur

hope. He first got my attention when he made the point that if you trace the linear distance from

the Irvine pizza place—where shortly before her murder Janelle Cruz got a cashier job—to her

house, and then from her house to Manuela Witthuhn’s house (the Golden State Killer’s other

Irvine victim), you get an almost perfect equilateral triangle. It’s not a large area, covering a

couple of miles at most. Somewhere in that triangle, the Kid theorized, lived the killer.

“You’re one of my favorite posters,” I wrote the Kid one day, and a correspondence began. Like

Deadheads trading concert tapes, he sends me a PDF of the 1983 Orange County telephone

directory; I send him a criminal record he’s looking for. We run down information on each other’s

favorite suspects.

“Too tall,” I write. The killer was between five feet eight and five feet ten.

“Hirsute,” the Kid comments. (The killer was not.)

We both agree geography is key. There are only so many white males born between, say, 1943

and 1959 who lived or worked in Sacramento, Santa Barbara County, and Orange County from

1976 to 1986. Of those locations, most followers of the case agree that Sacramento, where the

killer officially started his crime spree (unless it was indeed Visalia), is the ripest area to mine for

clues, beginning with the rapes.

I message the Kid about a possible suspect I’d uncovered. The man has an address history in

Sacramento, Goleta, and Orange County. I had found a photo of his car that he’d posted online.

The vanity license plate interested me—it alluded to building model aircraft, a hobby that some

had speculated the killer might be into. Now in his fifties, the man would be about the right age. I

all but had him in handcuffs.

“Haven’t done anything with that name in a while,” the Kid writes back politely. Included in his

message is the image of a dour nerd in a sweater vest, my suspect’s sophomore-year picture,

which the Kid already had on file. “Not in my top tier,” he writes. I am chastened—and

impressed.

While I share the Kid’s passion, I don’t have his skills. He’s an exceptional data miner. By his

calculation he’s spent 4,000 hours scouring everything from old directories to yearbooks to

online data aggregators in order to compile what he calls “the Master List.” When I first saw the

list, its thoroughness left me agape. It is a 118-page document with some 2,000 names and

information, including dates of birth, address histories, criminal records, and even photos when

available. There’s an index, footnotes. There are notations under some names (“dedicated

cycling advocate”) that seem nonsensical unless you know, as we do, far too much about a

possibly dead serial killer who was last active when Ronald Reagan was president.

The truth is, even the Kid is a little fuzzy on his motivation. “It’s the unidentified nature of EAR

that intrigues me more than anything else,” he writes me. “For no particular noble or tidy reason,

I want to know who EAR/ONS is.”

“At some point I’ll have to walk away from all this and move on with my life,” he says. Which is

why he opts for the monthly billing cycle rather than the annual service on Ancestry.com.

“I hope to hell I’m not still doing this a year from now,” he had written me—a year and a half

ago.

Not everyone admires the board sleuths or their efforts. One agitator came on recently to fume

about what he characterized as wanna-be cops with a twisted, pathetic obsession. He accused

the board of being populated by untrained meddlers with an unhealthy interest in rape and

murder.

“WALTER MITTY DETECTIVE,” he wrote.

By then I was convinced one of the Mittys was probably going to solve this thing.

THE NOTEBOOK

Trails. building. A lake. It looks like a rough map of a planned community; in fact, that’s what

Pool and other investigators believe it is.

The notebook pages were collected at the scene of a rape in Danville, in Contra Costa County,

in December 1978 by a now-deceased criminalist. The Golden State Killer, who was then

known as the East Area Rapist, was definitely the offender. Shoe prints and two independent

bloodhounds established his exit route, a trail that led from the victim’s house to some nearby

railroad tracks.

The paperwork, which is referred to as “the homework evidence,” was collected at the location

where the trail stopped abruptly, indicating the rapist got into a vehicle. Investigators believe he

dropped the pages unintentionally, perhaps while rooting around in a bag or opening his car

door. They are on standard college-rule paper, three-hole punch, ripped from a notebook but

with the spring binding intact. The first page appears to be a homework assignment on General

Custer (“General George Armstrong Custer, a man well admired but a man hated very much by

many who served him”).

The second page has the feeling of a journal entry or therapy exercise, an angry, resentful

screed about the author’s memories of sixth grade. “Mad is the word,” it begins. The author

recalls how he got in trouble in school and his teacher made him write sentences over and over

again, a humiliating experience. “I never hated anyone as much as I did him,” the author writes

of the unnamed teacher.

The third page is the hand-drawn map. Investigators examined the unusual markings on the

land area and figured out they represented a change of grade and elevation for drainage

purposes. Roofing is also an apparent interest: The two symbols on the bottom right are

standard indicators showing left- and right-side elevations of a house, suggesting rooflines.

Further analysis led investigators to believe the mapmaker possibly dabbled in landscape

architecture, civil engineering, or land-use planning. They’ve tried unsuccessfully to find the

area depicted on the map. Pool believes the drawing resembles Golden State’s preferred attack

neighborhood, and that it’s a fantasy.

On the back of the map, amid a series of doodles and girls’ names, is the word punishment

scrawled hard in black pen with the letter p written backward. Right above the word punishment,

in faint handwriting, are the words “Come from Snelling.” At least that’s what Pool believes. It’s

the last name of the man murdered in Visalia.

Pool and fellow investigator Holes are allowing me to publish this piece of evidence for the first

time, to accompany this article, in the hopes that it will jog someone’s memory—not unlike what

happened when a man recognized his brother’s extreme ideology in a manifesto released to the

media by police, which led authorities to the Unabomber.

I need to locate the area represented by the map, analyze the handwriting, and research the

references it contains. On the night I review the notebook, I have two thoughts: One, what a

promising lead this is for the case. And two, is this ever going to end?

NEW WORLD

I’ve always been a restless, jittery sleeper, prone to waking with a start. One night I’d fallen

asleep after reading the Original Night Stalker police files. The bedroom door creaked open. I

heard footsteps in the dark. Without thinking, I grabbed the lamp on my nightstand, leaped from

bed, and lunged at the figure in the room. It was my husband. When we discussed the incident

later, what was curious to us both is that I didn’t scream. In fact, I didn’t even swing the lamp. I

just asked a question: “Who are you?”

It was the only question I had anymore.

The world has changed for the Golden State Killer in ways he could never have predicted. We

know from the tennis shoe impressions under windows and how, for example, he knew exactly

when one victim would be home alone even though her husband had just changed shifts the

day before, that he was a voyeur at a time when physically standing in front of a window was

the only way to stalk. But if he’s alive, he’s growing old in a world where every day more and

more windows are opening around him—on computers, on smart phones, in DNA labs.

He couldn’t have predicted that one day we’d be able to identify people by a single skin cell or

that a quarter of a century after his last known crime, a stranger in Florida—who’s never been to

Sacramento and wasn’t born when the rapes began—could painstakingly cycle through a dozen

public records aggregators, narrowing down the possibilities, zeroing in on his name.

The Kid’s list reminded me of something he and I had connected over from the beginning. What

drew us to this mystery, we both agreed, was that it can be solved. Technology has made that

possible. I may not have what it takes to do so, but someone out there does.

I wonder at times if I need to step back. It’s not easy. Several months after our first meeting,

Pool tells me he’s decided to retire from the sheriff’s department and pursue a career in the

private sector. He will remain on the Golden State Killer investigation, however, describing the

case as “my great unfinished business.” He’s not the only veteran cop who refuses to give up.

During a family trip to Portland, I took a train trip an hour south to meet Larry Crompton, the

man whose book sparked my interest in this case, at a museum cafĂ© in Salem. He hasn’t

actively worked on the investigation since the ’70s, and he retired from the Contra Costa

Sheriff’s Department in 1998. But the toll the experience took on his life is still evident. “I was

supposed to catch him. And I didn’t,” he says. “I have to live with that.”

I think of the tag line from the movie Zodiac: “There’s more than one way to lose your life to a

killer.”

Crompton is dressed in a dark blue cotton shirt and has the stiff, rugged posture of a retired cop

turned rancher. He often pauses to find the kindest way to say something. He expended great

effort trying to warn his colleagues about the East Area Rapist: that he was going to return and

attack the other teenage girl in Walnut Creek (he did), that he’d moved to Southern California

and started killing couples (did that, too).

In return for his efforts Crompton endured frustration and heartbreak, though he’s too polite to

say that directly. He recalls the damaged  lives of the victims after the attacks, how many of the

husbands were riddled with guilt that they didn’t do more to fight back. The two of us sit long

enough for a distracted waitress to serve me five iced tea refills. At one point Crompton turns his

head and mutters to no one in particular, “I just want to catch him before I die.”

“If he were caught and you got to ask him one question,” I ask, “what would it be?”

He thinks for a beat and smiles mischievously. “Remember me?”

Then, becoming serious, he says, “What’d I miss?”

STOLEN LIVES

The police files depict in clinical prose the ordinariness of the victims’ lives in the moments

before the attacks—a single mom watching the last minutes of The Tonight Show in bed, a

teenager sticking a frozen pizza in the oven and setting the timer.

The Golden State Killer was a destroyer of all that was familiar and comforting to his victims.

Sex was secondary to instilling terror. It’s no accident that one of his signature threats was “I’ll

be gone in the dark.” He wasn’t a mere rapist. He was a phantom who kept his victims

perpetually frightened with the threat that he lurked, ligatures in hand, around every corner of

their unassuming tract houses.

One victim never went back inside the house where the crime took place. Another rape survivor,

victim No. 5, told me she came to despise her house. She had to stop skiing because of her

attacker’s ski mask. “And his black tennis shoes,” she said. “I’ll never forget them.” A former

nurse, she now volunteers as a rape crisis counselor. “I’ve forgiven him. He was such a heavy

burden on me for so long.”

Mad appeared to be his favorite word. Is it still? Or is he no longer the masked intruder working

the bedroom screen with a screwdriver but the father in the button-down cardigan checking the

locks on his back door?

In “Excitement’s Crave,” the poem he allegedly wrote, the Golden State Killer alludes to going

underground. “Sacramento should make an offer. / To make a movie of my life / That will pay for

my planned exile.” My bet is he’s enjoying a comfortable exile, leading an unremarkable life

among the unsuspecting. A suburban dad passing unnoticed behind the hedge wall.

The other night when I couldn’t sleep again, I opened my laptop, positioning it so as not to wake

my husband. I began studying Flickr, scrolling through Goleta Little League team photos from

1978. I couldn’t pull myself away from studying the men in the back rows, the assistant coaches,

the young dads, searching their faces for who among them might have been hiding in plain

sight, for the everyman with a baseball cap and a twisted glint in his eye.

In the past, when people have asked whether it worries me that the killer may still be out there,

I’ve waved dismissively, pointing out that he’d be much older now—62, if I had to guess. “He

can’t hurt me,” I say, not realizing that in every sleepless hour, in every minute spent hunting

him and not cuddling my daughter, he already has.