Ideas for better Web to Lead forms

We use web-to-lead forms pretty extensively for our Salesforce clients, because it is so much less expensive for them than integrating with the API.  We’ve found that WTL can work not just for ordinary leads, but also for simple event registration, volunteer signup, pledges, and many types of "applications" for service or grants.  Leads don’t have to be just people - they can bring in organization, donation, grant, or service information as well.

For example, we worked with a group that matches teen interns to other nonprofits that need interns.  The organizations that want interns apply for services on a web-to-lead form; the teen applicants sign up on another.  The first type of lead gets converted into an account, a contacts, and an internship "opportunity," while the intern applicants stay as leads until they are either matched to an internship (via contact roles) or rejected and deleted.

This is just one example of how web-to-lead has allowed us to set up simple website integration relatively quickly.

The more you use web-to-lead, however, the less you’ll like the HTML form that Salesforce provides you.  We edit the form pretty extensively, for several reasons:

  • To arrange and align form fields in a table and apply styles
  • To format phone numbers and other values as they are entered
  • To provide validation, making certain fields required and helping to avoid spam
  • To set hidden values, such as Lead Source or Record Type, that we don’t want to show on the form
  • To create or modify a picklist for values, such as Campaign

The first thing I do for web to lead is format the form in a table - two columns, with the labels at left and the fields at right. Then I add styles for labels and fields to the stylesheet.  For examples, take a look at forms for Teens in Public Service, Communities Connect Network, and Arts Corps.  To see the form’s HTML, view the source code for the page and search for WebToLead.

I will offer other a few other examples of web-to-lead techniques in subsequent posts.

 

Change and add fields in Force.com IDE

If you are using the latest Force.com IDE to develop s-controls or Apex code, you know how nice the latest upgrades are — for editing code, testing, and staying in sych with Salesforce.

I’ve just discovered something else really great — you can edit metadata for objects and fields in your Salesforce instance.  (It has to be a sandbox or developer instance, but you can then package and "deploy" your changes to a production instance.)

Have a custom object or a picklist in one instance and want to copy it to another?  Need to change a bunch of field names or picklist values?  You no longer need to package the items and install them from the appexchange, or go through all the pointing and clicking.  Instead, you make the changes in the object metadata XML files in Eclipse — you can use the XML design tools, or just edit the raw XML:

 

At first, I was getting a lot of errors when saving objects.  There is a bug, and I found the workaround here.  Basically, there is this file called package.xml — if you are adding an entirely new object (via the New menu), the Force.com IDE updates that file with your additions.  But if you just add custom fields, or if you copy and paste anything from one instance to another, it won’t be in package.xml, so you’ll get an error when saving or synchronizing to Salesforce. 

The trick is to open up package.xml, find or create the section that lists the type of thing you want to create, add the tags, save package.xml, and THEN save your new items.  For example, putting this code in package.xml lets me add the three custom fields shown in the Lead.object file above:

   
        Lead.Address_Type__c
        Lead.Birthdate__c
        Lead.Communication_Preference__c
        CustomField
   
Be sure to add the code to package.xml before EACH thing you add/paste and save, because Salesforce synchronizes package.xml when you save, taking out any entries that aren’t actually in your instance.

Apex in AppEx

At NPower, we’ve been making increasing use of Apex code to do some things we could not do before:

  • enforcing business rules across objects
  • updating records automatically across objects
  • rolling up data like membership renewal date and contact donation totals 
  • separating the web interface of s-controls from the code that actually modifies data

All great stuff!  And we love creating and testing Apex code (and s-controls) in Eclipse.  The latest release is really slick (more on that in another post).  But what we really wanted when this was all done was to give a consultant or a client a link where they could install this code into their own production instance of Salesforce.

Until this week, I thought the only way to install Apex code was to create a sandbox or developer account that exactly mirrors the account you want to install into, create and test all the code, and then deploy.  But I found out we can now package all this up into an AppExchange download.

I tried this out yesterday with a large package of apex, s-controls, custom fields, reports, and so on. The Apex code installed, tested, and deployed directly from the package link.

This will be a big timesaver for us — and in the long run, I hope it will make it possible for us to create powerful tools that clients can install with very little help from us.

Now all we need is the ability to package page layouts on standard objects.

S-Control for Filtering a Report

Some time ago, I had a client who needed an easy way for inexperienced users to filter a report, on a regular basis, based on several different criteria.  In Salesforce, anyone can filter a report like this, but it takes a couple dozen clicks and a bunch of typing.  I wrote a simple s-control that allowed users to filter the report in a really simple interface.

 

When the user selects values and then clicks Search, the Javascript code builds a long URL that tells Salesforce to open the report and apply all the selected filters - something like this:

https://na3.salesforce.com/00O50000001QCuS?pc2=00N50000001JsTx&pn2=eq&
pv2=American%20Sign%20Language&pc4=00N50000001JsUX&pn4=in&pv4=Immunizations&
pc5=00N50000001JvOE&pn5=in&pv5=North%20End& pc6=00N50000001JvNO&pn6=eq&pv6=1

I showed my s-control to Drew Piston at a Salesforce event last year, and it turns out he was hoping to do something similar for his group at the Bay Area Chapter of Red Cross.  This week, he posted a Jing screencast that shows his version of the s-control in action.

Thanks Drew! 

Apex Triggers Screencast

While reading Steve Anderson’s blog (http://gokubi.com), I was inspired to put up one of our screencasts. 

Anand was nice enough to put together a great screencast about creating a basic Apex trigger. This dives into some code but isn’t too technical that the average Salesforce admin can’t understand it. Take a look!

http://www.screencast.com/t/KZyKK0NXrXR

Salesforce and Open Social…blah blah blah

All the buzz last week was about Google’s announcement of its new cross-social networking platform Open Social (see ReadWriteWeb for more information). Salesforce is one of the founding partners and promises to create the ability to integrate social networking data (Plaxo and LinkedIn) into the business enterprise domain. For me personally, I was all aflutter by the idea.  That is, until I saw the cheesy Google Campfire video and the sf.com demo (minute 43).  While Theikos demo’d an interesting contact cloud application - which I have little doubt most nonprofits could not afford - it did not show much in the way of how Open Social was going to hook into sf.com.

The more I got to thinking about this, the more all this bugged me.  Sf.com doesn’t natively have the ability to do contact-to-contact relationships (similar to the account-to-account relationships in the Partner utility).  I’ve been told repeatedly by the great folks at sf.com that it’s a B2B application, and so there wasn’t much customer demand for C2C (reciprocal) relationships. So if sf.com has been working with Google on this for the past several months (year?), why is there no native C2C relationship building functionality in this release, or even on the roadmap? 

Vis-a-vis the Theikos demo, I’m left with the question: Will sf.com’s ability to hook into the Open Social platform rely on costly third party vendors to access C2C relationships?  Or is this finally the business case that sf.com has been waiting for to finally offer it as a feature (yet where’s the promoted Idea?)?

Nonprofits using Advanced S-Controls and Apex

I want to show you how a particular nonprofit is using Apex code: the Center for Employment Opportunities (http://www.ceoworks.org).  They demo’d their Salesforce configuration at the NYC Nonprofit User Group (run by Lisa Glass-Kornstein, just back from her honeymoon!).  They use Apex to do complicated business logic like cross-object verification and data transfers based on triggers.  I know Jessie Grenfell from CEO is going to update this presentation, but I figured I’d get it out there so people can see it.

Are you using S-controls or Apex in your organization?  What business process are you solving with these tools? 


By rob