Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Create the shell of your document, have an idea where you want the fields to go. Types of fields you may have in your Word document.
    • Fields directly from the record in Salesforce
    • Fields from related records in Salesforce
    • Formulas on the record in Salesforce
    • Image fields from documents uploaded to Salesforce
    • Paragraphs of text that are conditional in Word depending on a field in Salesforce
    • More advanced word fields
  • Create any formula fields on the main Object in Salesforce
    • This is a balancing act - do you want the logic in the Word document or in Salesforce. I think have all the logic in Salesforce and the end result in Word. 
      • Eg you need a clause to appear in Word if the Type is A, B or C. 
        • Create a formula field in Salesforce named TypeClause
          • I ALWAYS add a note in the Description field to note that this field exists only for the Merge Documents - eg CONGA or MERGE
          • Type = Checkbox
          • Formula OR(ISPICKVAL(Type,"A"),ISPICKVAL(Type,"B"),ISPICKVAL(Type,"C))
        • Add a Word Field to your document (ctrl +F9)
          • IF <<TypeClause>>="True" "The contents of your para" "" (ensure you enter TypeClause correctly depending on which app you are using. 
  • If using Conga, create a Report Type to include all the related fields that you want to use. Custom Report Types are way more useful than creating formula fields for every related field you want to include on your merge document.
    • Or use SOQL Queries - they are more robust, less prone to people modifying them or deleting them, and you need Queries if you are working with Partner or Customer communities documents. 
  • If using Drawloop, set up the relationships in the Loop setup screen for all the related Objects.
  • Create documents records for your images, and then add the image URLs to fields on the record. 
    • Eg you want a conditional logo to appear on the document based on what product it is. 
      • In the product object, add a new field for image file. 
      • Add the externally valid URL to the image file field. 
      • Add that image field to your Report Type (Conga). 
      • Add the image field into your word document (it's different syntax for Conga or Drawloop). 
      • Ensure that the image size is the exact size to fit within the margins of your word document. 
  • Add all the correct Merge fields into your document
    • I like colouring all the fields until the document is complete (yep, it is blurred out). 

Image Added

  • If using Drawloop, upload your template, if using Conga, you can test before you upload your template. 
  • If using Conga, create your button. 
  • If using Drawloop create your Loop setup and your button button. 
  • Set up the record in Salesforce to have all the test data in it
  • Test Test and Test again. 
  • Test with different Salesforce records 
  • Rinse and repeat

Merge Field Tricks

Image Added

A snippet of the above document. 

Note Show Field Codes and Show Formatting Marks are turned on - DO NOT TRY TO WORK WITH MAIL MERGE DOCUMENTS WITHOUT THESE SETTINGS TURNED ON!

Note the extensive use of Word IF Fields. 

Basically I set up a checkbox field or formula in my object to determine if a section of text should display on the document. 

I use Word Fields to 

Anchor
repeat
repeat
Modifying the Mail Merge document

...