Last week when Salesforce announced it was buying ClickSoftware for $1.35 billion you might not have realized it, but the law firm Shearman & Sterling was advising Salesforce throughout the deal. In fact, there are lawyers involved in every transaction of this sort, from the initial call to the closing.

As you would expect, there are hundreds of tiny details involved in bringing a deal to fruition, from checking the validity of the offer to checking the financial health of the target company, negotiating a price and terms and clearing it with the boards/stockholders. Even after the deal is signed and agreed upon by both companies, the lawyers often have to ease it through the regulatory process before it finally closes.

The attorneys act as project managers, working with company executives and boards of directors, guiding them through the lengthy transaction process, advising them on the legal side of the equation — all while working with the investment banks to make sure everything goes as smoothly as possible.

Looking for a target

A company like Salesforce doesn’t go out and buy ClickSoftware randomly. There is in fact a method to its M&A madness. As I wrote in an article describing the process in 2016: