Deprecated: Assigning the return value of new by reference is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 248

Strict Standards: Non-static method GoogleSitemapGenerator::Enable() should not be called statically in /home/warped/public_html/sfdc-heretic/wp-content/plugins/sitemap.php on line 2452
Salesforce Heretic » Mail Merge - The Third Rail of Salesforce.com

April 14, 2006

Mail Merge - The Third Rail of Salesforce.com

Filed under: Salesforce.com, Mail Merge — heretic @ 5:22 pm

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

Mail Merge — What I’m sure is one of the most used extensions to Salesforce.com, is also one of my most hated things. In fact, every time I hear it come up I cringe, because I know it’s not going to be good. I’ve gone as far as to label it The Third Rail of Salesforce.com. (Ok, so I kinda stole the thrid rail bit from Social Secuirty and Politics, but it fits…)

When one of my clients was evaluating new CRM packages circa July/August 2004 we ran Salesforce.com through it’s paces. We tested the security model, custom fields, even ran a quick test mail merge… We knew we’d find some limitations, no surprise to anyone really, but everything seemed ok. The client migrated all his data and went live Oct 1st, 2004. And woah did we miss something with Mail Merge…

So, this client, like many others I’m sure, uses mail merges to present quotes and proposals. They are also a B2C company, so there’s alot of ‘people’ fields involved. Even on a simple postcard we had problems with the merges comming out of SFDC. Let me give an example, simple, postcard. The following is also used on just about every letter and proposal merge as well.

We start by adding a custom field to the Contact and Lead objects called “Formal”. It is a simple picklist with two choices, “FORMAL” and “INFORMAL”. (You could also use a checkbox but this is quicker to scan/read on the page and harder to confuse.) It’s purpose is to determine if someone is addressed “John Doe” or “Mr. Doe”. Fairly simple expression. In the merge document you use a Word conditional statment (IF) to determine if you print the saluation field or the first name field for the person. This is what we didn’t test before we went live…. Whoops.

One would think that because the (IF) conditional is a standard feature of Word Mail Merges, and SFDC supports Word Mail Merges this would be a no brainer. Unfortunately it’s anythig but. When you merge that document in, sometimes the (IF) conditional gets evaluated, sometimes it doesn’t. When you’ve got 30+ of these (IF) statments in a merge doc it becomes a huge mess. We told all our users they had to CTRL-A (select all), rt-click on a merge field, and select “Update Field Codes.” to correct the problem. Unfortunately that isn’t perfect either.

So about 6 months ago, with no resolution in sight, we began work on constructing our own workaround. And what a PITA that was. But it’s got some nice perks… Once you have your own mail merge tool you can do some really cool things. Mail merge to multiple contacts/accounts/leads and create activities for them, or support Firefox / Mozilla, how about Wordperfect? OpenOffice? Humm… Mac? Linux? Humm.. I can hear the druel hitting the desk now.

Over the next few weeks I’m going to be posting pieces of the mail merge puzzle, and at the end posting up my code for our drop-in replacement. But before you get all giddy with delight, there are two limitations, one I think is an SFDC bug, really, the other not so. First, SFDC will allow you to use merge field names in Word that are technically invalid. If your field label has a “/” character, it’s likely your merge field label does too. If that’s the case you’ll have to correct those fields. Personally, SFDC should be ‘translating’ those characters out of the merge field names before passing it to Word, but… The second problem, and it’s a biggie for some companies, if you use mail merges in your opportunities, and want to merge in line items, you can’t. My theory is it’s that last limitation that pushed SFDC to implement Mail Merge in the way they did.

One last point: Over the last two weeks my users still using the native SFDC mail merge implementation have been reporting a large number of problems with Mail Merge. According to a post on the Salesforce forums when selecting the merge document and contact to merge to you can now press CTRL+SHIFT+N to get a ‘new’ version that may fix some problems. Unfortunately not mine. :(

License

This work is published under a Creative Commons Attribution-ShareAlike 2.5 License.


Strict Standards: Only variables should be assigned by reference in /home/warped/public_html/sfdc-heretic/wp-includes/functions.php on line 590
« Progmatic Access to Salesforce.com Reports  
Strict Standards: Only variables should be assigned by reference in /home/warped/public_html/sfdc-heretic/wp-includes/functions.php on line 590
Salesforce.com Mail Merge, Part II: “Word made me do it…” »

9 Comments


  1. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

    Actually I can’t even get mail merge to work right now with documents that exeucuted perfectly a few weeks ago. Salesforce is having serious issues with it and isn’t releasing a timeline for these to be fixed.

    Comment by
    Deprecated: Function ereg() is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/google-analyticator.php on line 272
    Jaded — April 14, 2006 @ 6:59 pm


  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

    I´m a german user, so please excuse my english…
    I still fight with the conditional issue, too! We tried to work around this using Excel sheets within the Word application. Only then, describing what to do when no data is written in the required field we were able to “kill” the description in that line and also the empty line itself. For example: I don´t want Word to write “discount” when that special account gets no discount at all! It would be much easier and close to the original concept to get along using Word only… Someone´s got an idea?

    Comment by
    Deprecated: Function ereg() is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/google-analyticator.php on line 272
    Jubub — April 18, 2006 @ 4:21 am


  3. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

    In the defense of mail merge:

    When it was written (over 3 years ago, which is saying something as it has never been patched until now and there are over 15 thousand HAPPY customers using it) we had to EXACTLY duplicate the results generated by a now defunct company called hotpaper. Maybe not a great decision but there it is.

    Supporting conditional merge field logic was not considered (I’m really surprised it works at all).
    We also wanted to support a basic quoting system (opportunity stuff mentioned above) which, while not impossible using a native merge, would still require modifying the word doc at runtime.

    So to do that, I wrote a search and replace system that walks the document and swaps in the values.
    So no native merge ?

    That said, the code that is going into production this week has a plugin system that allows people (like this gent) to swap out the standard search and replace component with their own component (perhaps one that simply runs the native word merge).
    You can also swap out the data generation bit.

    The new code is also scriptable, so it can be used in a scontrol to generate bulk results.
    This will be available in AppExchange soon as something you can go and install.

    Now as far as back end merge goes I wish you luck using open office etc. People have tried and failed to even get good support for ONE version of Office, let alone Office 2000 and up.
    I also wish you luck running Word on the back end to generate results (which is NOT recommended by MS and is what hotpaper did, and where are they?).

    NOTE: The problems with mail merge lately are related to the new production network stack dropping connections in a very unfriendly way.
    Our network guys are a bit baffled but since I have v 2 in the pipe (which has an upgraded network layer) we are more focused on getting that out the door, which will be this Friday (there is your timeline).

    Comment by
    Deprecated: Function ereg() is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/google-analyticator.php on line 272
    Chris Hopkins — April 18, 2006 @ 12:28 pm


  4. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

    […] Back in our introduction to this series, I elaborated on some of the issues surronding Mail Merges in Salesforce.com. In this part we’re going to look at how Word handles a Mail Merge, and figure out how we’ll get our data ready to be merged. […]

    Pingback by
    Deprecated: Function ereg() is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/google-analyticator.php on line 272
    Salesforce Heretic » Salesforce.com Mail Marge, Part II: “Word made me do it…” — April 18, 2006 @ 12:48 pm


  5. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

    […] In a comment today on a post about Word mail merge in Salesforce.com over at Salesforce Heretic, it was announced that Salesforce.com is releasing a new mail merge system via the Appexchange in the next few days. […]

    Pingback by
    Deprecated: Function ereg() is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/google-analyticator.php on line 272
    gokubi.com » Blog Archive » New mail merge facility coming soon in Appexchange… — April 18, 2006 @ 2:06 pm


  6. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

    This is probably THE biggest downside to Salesforce that I can that is/will be a point of pain for day to day users.

    Very cool that they are addressing the issue.

    Thanks for the post!

    Comment by
    Deprecated: Function ereg() is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/google-analyticator.php on line 272
    Eugene Chan — April 18, 2006 @ 2:49 pm


  7. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

    […] So, in a quick recap, we’ve already laid down, in general terms anyway, why we’re doing this, and generally how we’re going to do the merge. Now it’s time to get the data. […]

    Pingback by
    Deprecated: Function ereg() is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/google-analyticator.php on line 272
    Salesforce Heretic » Salesforce.com Mail Merge, Part III: “Spaulding, this calls for the ole Billy Barule…” — April 21, 2006 @ 11:30 am


  8. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

    […] If you haven’t read them parts I, II, and III get into how were going to do the merge, as well as how we’re going to get the data. At this point we’ve settled on using the XML merge feed from the Salesforce.com UI, and we’re going to generate CSV data to get fed into Word. […]

    Pingback by
    Deprecated: Function ereg() is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/google-analyticator.php on line 272
    Salesforce Heretic » Salesforce.com Mail Merge - Part IV: — April 25, 2006 @ 10:56 am


  9. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 260

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 261

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 262

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-content/plugins/codesnippet/codesnippet.php on line 263

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/warped/public_html/sfdc-heretic/wp-includes/functions-formatting.php on line 76

    What happenned to the new word mail merge system? Don’t see either heretic’s code package or the Appexchange system. An easy-to-use bulk mail merge is preventing us from acquiring salesforce.com.

    Comment by
    Deprecated: Function ereg() is deprecated in /home/warped/public_html/sfdc-heretic/wp-content/plugins/google-analyticator.php on line 272
    Hobo Jojo — November 28, 2006 @ 10:24 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.