Editing Word Templates and Adding in 'Check Boxes' in the merged document

1 minute read time.

A customer had a requirement to present data from a checkbox field in a merged document in a more attractive way.

I had added two fields to the person table, both of type checkbox.

  • pers_workdividendapplies
  • pers_workstatusconfirmed

I then added the fields into the view vMailMerge that is used when conducting a mail merge in the context of the Person entity.

I then created a new Document Template that included the fields. If you are not familiar with how to do this then I recommend reading the section on Document Templates in the System Administration Guide.

The fields when merged with my first template looked like this:

BUT. I didn't want to display a 'Y'! I wanted to display a 'tick' mark.

In order to do this I knew I could use the features of Word merge. This is because once the data from Sage CRM has arrived in Word the merge is carried out using Word's own regular features. This meant I could use the conditional merge behaviour. Just as it is possible to add "Today's Date" into a template so it is possible to use "if, then else" behaviour.

The 'Y' that was displayed in my document was sent from Sage CRM. And a 'tick' or a 'cross' symbol can be obtained by using the characters of a font like 'Wingdings 2'.

So I needed to change my template so that as my merge was carried out the merge fields would substitute the 'Y' or 'N' with the appropriate character in the Wingdings 2 font.

I used R expressed in Wingdings 2 to be the 'tick' and T to be the 'cross'.

And once I had merged the document the result looked like this:

This was a much more pleasant way of conveying the information.