Advanced Apex Programming for Salesforce.com and Force.com

August 5th, 2012

Advanced Apex Programming for Salesforce.com and Force.com

As many of you know, I do enjoy writing books. Which is a good thing given that I’ve written quite a few of them. I’m proud of all of my books, but there are a few that fall into a special category – and that includes my latest effort.

If you’ve looked at the book market, you’ve probably noticed that a lot of books are very similar. Most subjects offer dozens of competing books that have pretty much the same content. Personally, I’ve always felt that if a good book exists on a particular subject, I shouldn’t waste my time writing another one. As a result, most (if not all) of my books have been either unique, or the first one in a given space. For example: my original Visual Basic Programmer’s Guide to the Windows API was the only book for a long time that dared to teach Visual Basic programmers to use the Windows API. My recent book on teaching leadership skills to teens is nothing like anything else on the market.

Which brings us to Advanced Apex Programming.

As I mentioned in my previous blog post, I’ve been spending more and more time over the past few years working in Apex – the native language of Salesforce.com. I’ve learned a great deal in the process and… well, you know how it is. Sooner or later, if I learn something, I end up writing a book to teach it. In this case, I was astonished to find that nobody has written an advanced Apex book yet. There’s lots of great reference material, a good selection of articles, and plenty of beginner’s texts out there. But there was no book to help the intermediate developers take the next step, and give the advanced developers something to geek out to. Even the domain, AdvancedApex.com was available!

I couldn’t resist.

You can read about the book at AdvancedApex.com. I’m as excited about it as I was that original VB Programmer’s guide. As with that book, I think it’s going to help a lot of programmers write a lot of great code and become more successful. And as an author, hearing from readers that a book I’ve written has helped them build their careers is what really makes it worth the effort.

Leaving stealth mode

June 25th, 2012

For the short version of this story, check out http://angel.co/full-circle-crm

Has it really been over a year since I last posted? Wow. The main reason things have gone quiet is because, somewhat to my surprise, I’m doing another startup, and we’ve been in that mysterious state of being known in the industry as “stealth mode”. And now, it’s finally possible (even advisable) to write about what I’ve been up to.

In some ways, it’s a rather “boring” startup. We must forgo the drama of wondering if we can develop a prototype into a real product, if that product will find demand, if we can recruit an executive team and if we can find a business model that works or a way to monetize the business.

We have a great executive team. We have a product (and believe me, I know the difference between a product and a prototype). We have a simple business model – providing a solution to a business problem that companies are willing to pay for. And we have paying customers.

Of course there’s still plenty that needs to be done, but I think we have a pretty good foundation to grow on.

So what do we do? Our team calls it “Moneyball for Marketing” – it runs on Salesforce.com and provides a way for companies to accurately figure out the value of marketing campaigns, understand their sales and marketing funnels, and market to existing customers as easily as to new leads. I’ve been assured by my co-founders (and customer responses) that these are all good things and very exciting.

As a software developer, I’m much more excited by the product itself. It represents the culmination of another unexpected twist in my career. As many reading this know, I’ve spent most of my career as a developer, author and speaker on Microsoft technologies. Well, about 5 years ago, I was called in by a friend to help write some triggers for a Salesforce.com organization. As time went on, I found myself doing more work on the platform, including some larger customizations and applications, to the point where I was actually doing most of my development work in Apex (the underlying language of the Force.com platform). I still do .NET code of course, but now it includes Force.com/.NET integration as well. I find writing Apex to be a uniquely interesting and challenging experience, and (to be perfectly honest) a great deal of fun.

Full Circle CRM Response Management (that’s the name of the product), is one sweet piece of code. I’ll be writing more about that shortly – there’s more to this story. But for now, suffice to say that I’m quite proud of what we’ve built. It’s reliable, scalable and even innovative (and yes, I do consider reliable and scalable to be as important, or more important, than mere innovation).

I invite you to check out the company profile at http://angel.co/full-circle-crm, and visit our website at  fullcirclecrm.com

And stay tuned. I promise my next post won’t take a year.

Specialization is for Insects

April 25th, 2011

Recently, for a variety of reasons, I’ve been asked about my background. It’s a question that can take some time to answer. To answer why, allow me to share one of my favorite quotes by Robert A. Heinlein:

Specialization is for Insects

A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.

I can only do about half of these myself, but I’ve always agreed with the sentiment. Back in college my advisors all explained why it is important in one’s career to specialize. But I’ve always chosen breadth over depth. My ideal has never been the specialist, but rather, the synergist – someone who can combine multiple skills and talents to come up with creative and unique solutions to problems.

Some would argue that when one tries to do many things, it becomes impossible to do any of them well. This is not true. What is true, is that if you do not specialize, it becomes impossible to be the very best at something. I know this, because for a time in my career I did specialize in a specific area of technology and became one of the best at it anywhere. Now, I can safely say that I am not the best at anything. But it does not mean I don’t do a lot of things very well.

What might Heinlein add to his list if he were writing for today’s technical society?

A human being should also be able start and run a company, speak in front of a group (any size), write a book, film and edit a video, plan an event, write and place an ad, teach a class, read or write a financial statement, manage investments, work with spreadsheets, write production quality code (on several platforms and in multiple languages), handle a TV or radio interview, mentor a kid, build a computer, wire a network, play an instrument, configure a firewall, architect a complex software system.

Ok, that might not be his list, but it is at least part of mine. It turns out that if you spend time doing a lot of different things over enough years, you can actually become surprisingly good at them. You can even find connections – ways different knowledge sets overlap – that a specialist might never see.

So if you are still early in your career, I encourage you to create your own list. Don’t limit yourself to the confines of what you are taught in school or at work, or what you think you are supposed to be learning. And please don’t limit yourself just to technology – there’s a lot more going on out there.

And if you’re visiting this site to gain some insight into my background, suffice to say – it’s a long story. I like to think that were it possible for me to meet Heinlein today, he would, after some conversation, judge me to be a human being. Coming from him, I would consider it the highest of compliments.

And now a book of a different sort

March 1st, 2011

Developing Teen Leadership: A Practical Guide for Youth Group Advisors, Teachers and Parents

Cover for "Developing Teen Leadership"

In addition to my technical career, I’ve spent over 20 years volunteering as a youth group advisor with a group that emphasizes youth leadership.

I really believe that in today’s world, academic success is not enough to achieve success in a career or in life. It takes more. Call them social skills or communication skills, or initiative or the ability to plan and execute a task… All of them fall into the category of leadership skills.

Over the years I’ve learned a thing or two about how to teach these skills, and have just published a new book on the subject. Like my technical books, it is a practical “how to” guide – not an abstract theoretical tome. Unlike my more technical books, it’s an easy read and, I hope, entertaining as well as useful.

Whether you are a coach, scoutmaster or youth group advisor, a teacher, or even a parent of a teen – I’m confident that this book will offer both insight and practical strategies to help you become more effective at teaching leadership skills, and better able to help teens prepare for an increasingly complex future.

You can read more about it at TeenLeadershipBook.com.

The Accidental Shopping Cart

October 25th, 2010

I wrote an online store. I didn’t really want to, but I just couldn’t find a solution that fit my needs.

I wanted a shopping cart that had really good extensibility – one that could connect to our licensing server not just to allocate keys, but to perform custom operations like allowing purchase of additional installations for existing keys.

What I found was largely disappointing. Not that there weren’t some great packages out there. If I wanted to set up a large online store with many products, it was clear that setting up my own Amazon.com equivalent would not be hard at all. There are any number of powerful online stores with numerous features available. But none of them had exactly the right features, and none had the extensibility I needed.

What I really wanted was a shopping component – some ASP .NET controls that could be dropped onto any ASP.NET page and would somehow work together to implement a shopping cart. There would be a control that would “add to cart” a single product – and a page could have any number of these control to display multiple products. There would be a shopping cart page that would allow modification of quantities or deletion of items from the cart. And there would be a checkout control.

In my ideal solution checkout would be handled by an external processor such as Paypal, and once the order was confirmed my code could issue license keys, download links, send out customer Emails and so on.

After searching through and installing trial versions of numerous packages, I came to realize that none of them came close. The truth is, I didn’t want an online store – I wanted an online store component.

So I wrote one. The excuse I used to justify the time was that it would make a great application note for the latest version of our licensing system. But in truth, it sounded like a lot of fun – and it was. I ended up using authorize.net for the credit card integration (they have the best online documentation for developers of any of the card processors I found other than perhaps Paypal).

There’s still some work ahead to turn it into an application note for distribution, but the store is now live at http://desaware.com/purchase/store.aspx.

Above all, the experience confirmed to me the rightness in the way we decided to extend the licensing system for the newly released version 2. Instead of piling in features, we focused on enhancing the extensibility model. Our licensing system is not so much a licensing application as it is a licensing component – and right now it’s hard for me to imagine a licensing scenario that it can’t implement.

If Microsoft Ran The Economy

July 19th, 2009

One of the major criticisms I’ve heard over the administration’s plan to regulate the financial industry is that it might “stifle innovation”. This puzzled me, as it seems excessive “innovation” is what got us into this recession in the first place. But if innovation in the financial industry is, in fact, a good thing – it seems logical that said industry should be run not by bankers, and not by government bureaucrats, but rather by an organization that has expertise in managing innovation. Following this logic one can’t help but wonder what the economy would be like if it were a Microsoft product….

Loans

There are no sub-prime loans in the Microsoft economy. Nothing sub-prime would ever be shipped. True, many customers would end up with version 1.0 loans that would occasionally run into problems – payments might mysteriously fail to get recorded or interest rates change without logical reason. But don’t worry – everyone could get their loan upgraded for a nominal cost when a new version comes out – refinancing would go smoothly for 99.5% of customers, only a small number would crash into spontaneous foreclosure.

Microsoft loans will come with legal agreements as long and incomprehensible as any we see today. And just like today, nobody would read them. Unlike today, it would never matter.

Derivatives and Credit Default Swaps

Microsoft has extensive experience creating incredibly complex products that almost nobody understands (COM, WCF, etc.), which makes it the ideal organization to take over the development and marketing of financial derivatives. However, unlike today’s financial products, Microsoft derivatives would undergo extensive testing both internally and through a massive pre-release beta and preview program to customers ranging from individuals to the largest banks.

With thousands of amateurs and experts able to download and examine every derivative and credit default swap before release, most potential problems will be discovered long before they are actually deployed. Sure, they will ship with some bugs, but the odds of bugs significant enough to crash the economy will be very small. Any such serious bugs discovered after release will be quickly patched using the Microsoft automatic update service for financial instruments, that will be included with every copy.

Executive Bonuses

Microsoft licenses products generally by machine or user. Microsoft doesn’t care if you are using Word to write a 3rd grade paper or a billion dollar contract, so it won’t care if a Microsoft fund has a thousand dollars or a trillion. From loans to hedge funds, once you’ve bought the product, there are no further charges (other than support or upgrade fees). Fees for financial products will be based on number of customers, but not the size of the product. Fees and costs will drop – and large bonuses and salaries will vanish. Of course Microsoft product managers will be paid a decent salary, and will have some company stock options that might become worth something someday. But the days of huge executive bonuses at institutions that are losing money will be over.

The overall economy

Our existing economy is a complex and bloated system with a long history of solid growth and productivity punctuated by booms and crashes. Microsoft Windows is also a complex and bloated system with a long history of solid growth and productivity punctuated by booms and crashes.

However, unlike the real economy, when the Windows run economy stutters, most of the time it can be fixed in short order with a quick reboot. Those rare crashes that occur are typically also solved by a reboot, and only occasionally need a complete reformat and restore.

Imagine an economy that can be rebooted in hours instead of years. One with extensive documentation and transparency as provided by MSFN (Microsoft Financial Network).

The mind boggles at the possibilities. The Bernie Madoff’s of the world would have no chance in an economy where dozens of vendors sell SAV (Securities anti-virus) software. Hundreds of thousands of developers will build financial products for the new economic system (run your own bank, publish your own credit card). And there would be no secrets – anything you ever wanted to know about the economy or any financial product or institution would be instantly available to view – on Google of course…

Putting a Machine to Rest

June 7th, 2009

You’d think getting rid of an old computer would be easy.

Now, if it’s not a very old computer – say, a year or three, it’s easy: just restore the computer from its restore partition or backup DVDs, run a program like Eraser to overwrite the unused space with random data to make sure no personal information is left, and give it to a friend or donate it to a local organization.

But what if it’s a really old computer – say 10 years or so? In that case you have a much bigger problem. Disposing of the hardware itself won’t be hard – your local electronics recycler will be glad to take it off your hands. But that’s the easy part.

I know what you’re thinking. What am I doing with a 10 year old computer? Well, as you know, I run a software company. And we still occasionally get support calls on very old legacy software, which means we need to maintain the ability to debug or build some pretty ancient code. So when a new machine comes in, the previous machine remains frozen in time.

Now you may think you don’t have this problem, but let me ask you – how long have you had a computer? It may well be 10 years or longer. If so, you may have some old documents from back then that you’ve been carefully backing up or copying to your new machines each time you upgraded. But can you read them?

Read the rest of this entry »

Mama, don’t let your babies grow up to be coders

June 1st, 2009

A few  months ago I wrote a column for Visual Studio Magazine titled “Where have all the developer’s gone” in which I pointed that interest in programming and computer science seems to be dropping – at least in the United States. And in fact, much of the interest in learning programming seems to be in countries like China, Pakistan, etc. I concluded with a somewhat cautionary note that if we want our kids to become the technologists of the future, it’s up to us to do something about it.

This brought forth a great deal of comment, one of the most interesting questioning why anyone would encourage their kids to go into the software business in the first place. Why would you go into an industry where it’s increasingly difficult to keep up, where jobs are increasingly being outsourced, and where there is rarely long term career viability? Doctors can continue treating patients into their 60’s and 70’s, Lawyers continue lawyering, bankers banking and politicians politicking until they drop dead (and sometimes longer in the case of politicians). But past 40 or so, software developers who aren’t fortunate enough to have solid management gig are likely as not to find themselves unemployed or in some other career.

I’ve been particularly fortunate in this regard. Through a combination of being self-employed, honestly passionate about technology, and a bit of talent, I’ve had the opportunity to continue coding. What’s more, I’ve had the freedom to diversify into all sorts of new technologies beyond my core expertise. But keeping up is an effort. I often compare the life of a software developer to that of Alice in “Through the Looking Glass” – where Alice is told by the Red Queen that she has to run as fast as she can just to stay in place, and to make progress she has to run even faster

Why would anyone wish this on their kids?

It seems that our interests as a nation are radically different from our interests as individuals. There is no doubt that we need a lot of skilled engineers and programmers going forward. Not only do we need to maintain our existing technological base, there’s going to be increasing demand for power engineers and some incredibly sophisticated software to handle the future smart grid (or EnergyNet” as Juval Lowy calls it). Where are those developers going to come from?

I suppose we can continue to import them. But will the United States continue to be a desirable place for migrant technologists? To some degree it is likely, but as their local economies develop, they may find better opportunities at home. And many engineers consider foreign workers to be part of the problem – competition that makes it even less desirable to enter the business. But let’s assume for the moment that for the foreseeable future foreign nationals will continue to provide needed support our technological society, and that it is in our national interest for them to do so – thus making home-grown talent less essential.

What do you encourage your kids to study if not technology?

Read the rest of this entry »

This New Machine

May 22nd, 2009

About two years ago I wrote an entry titled “This Old Machine” in which I described my search for a travel laptop – something to use on casual trips when I didn’t need to lug around the full sized laptop I used for conferences. I had some specific requirements – it had to be small and light, and low stress – meaning that if it did get lost, broken or stolen, it wouldn’t be the end of the world. And while the goal was to use it primarily for Email, web access, and storage/editing of vacation photos, it had to have enough horsepower to handle serious applications in a pinch: Visual Studio, SQL Server Express, etc – the kinds of applications that a professional developer might need to use.

At the time, I ended up upgrading an old Thinkpad 240 – a machine that today would be called a Netbook, but that anticipated that class of machines by almost a decade. And it served tolerably well. It was slow enough to be annoying, and the battery life was worthless, but it was good enough.

This summer I wanted something better, and with all the talk about NetBooks I decided it was time to take a look and see if any of the new machines would serve my needs. After reviewing specifications and reviews, I ended up snagging an Asus Eee 1000HE PC.

Honestly, I did not have high hopes – laptops are almost by definition studies in compromise. But I ended up being blown away. This is a nice machine. You can read the full review in my gadget column. Suffice to say that with a 2GB memory upgrade, it has plenty of power for casual development work, is easily small enough to fit into a book bag or backpack, and at a hair over 3 pounds with over 7 hours of battery life is truly portable.

Oh yes, and I will never buy another laptop without a multi-touch touchpad.

Read my full review

Old Tech Rules

February 26th, 2009

Yesterday I needed to do a simple Excel add-in.

No problem, right?

Being an experienced .NET developer, I figured this would be a good time to try the Visual Studio Office system – to create the add-in using VB .NET. I mean, how hard could it be?

Not hard at all as it turned out. The project template for the add-in worked well, and it took no time at all to find some simple examples online to build on. I had enough familiarity with the Excel object model to make short work of the task at hand, and the integration that allowed debugging of add-ins in Visual Studio worked brilliantly.

Then it came time to test deployment – as I needed to provide this add-in to a couple of clients.

What a fiasco.

The setup project that was created didn’t work. The instructions on MSDN and other sites for diagnosing problems were complex and unreliable. I found additional articles with suggestions for creating custom installation actions to handle the security issues that might have been the problem. There were clearly differences between versions of the Visual Studio office runtimes depending on framework version and versions of Excel to support, with no clear explanation of which to use and how to create a deployment that will work with both.

I spent as much time trying to figure out the deployment as I did creating the add-in when I decided I was wasting my time. The Visual Studio office support may be nice, but the deployment solution and documentation is abysmal. Microsoft should be ashamed to have released it. It is perhaps the most disappointing experience I’ve had with any Microsoft developer technology.

I ended up porting the code to VBA in an Excel workbook and creating a .xla Excel add-in. Though I missed the intellisence of Visual Studio, the building and debugging experience was fine. And deployment was trivial – save the workbook as an add-in. Deployment consisted of browsing to the add-in file and enabling it – and the add-in worked perfectly on Excel 2003 and 2007 the first time I tried it.

I’d come to think of .NET as current technology rather than the wave of the future. It’s clear to me that at least when it comes to Office, .NET is still future technology – costly, complex and unreliable. If I need to do any more Office add-ins, you can bet I’ll stick with VBA.