web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Syntax Error! Calculating Mail Merge Fields

(1) ShareShare
ReportReport
Posted on by

I hope someone can help. I am getting a Syntax Error! when trying to calculate a mail merged field in Word 2013. I use CTRL+F9 to add the {} and within those brackets I insert the Merge Field and create the expression as follows, but get a SyntaxError!:

{= {MERGEFIELD Setup___Once_Off_Fee} * 1.14}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mamatha Swamy Profile Picture
    5,426 on at
    RE: Syntax Error! Calculating Mail Merge Fields

    Andrea,

    I just tested it and found that the problem occurs with the fields of type currency in CRM. I was able to use the expression just fine with numeric field. I guess the currency symbol is causing the problem

    Try posting this in Word community. Experts there should be able to help you strip off the currency symbol and do the calculation.

  • Community Member Profile Picture
    on at
    RE: Syntax Error! Calculating Mail Merge Fields

    I believe you need a field to hold you calculation.

    {QUOTE{Set Val{MERGEFIELD Setup___Once_Off_Fee}}{Set Val2{1.14}}{=Val1*Val2}}

  • Community Member Profile Picture
    on at
    RE: Syntax Error! Calculating Mail Merge Fields

    I tried your suggestion but still get a SyntaxError!

    {QUOTE{Set Val1{MERGEFIELD Setup___Once_Off_Fee}}{Set Val2{1.14}}{=Val1*Val2}}

  • Mamatha Swamy Profile Picture
    5,426 on at
    RE: Syntax Error! Calculating Mail Merge Fields

    Your expression is correct., verify it with field of different type. Currency symbol ($) is causing the issue

  • Community Member Profile Picture
    on at
    RE: Syntax Error! Calculating Mail Merge Fields

    I have tried the same with a non currency field and get the same SyntaxError!

  • Aileen Gusni Profile Picture
    44,524 on at
    RE: Syntax Error! Calculating Mail Merge Fields

    Andrea,

    Make sure you have added the field in the Data Fields?

  • Community Member Profile Picture
    on at
    RE: Syntax Error! Calculating Mail Merge Fields

    Maybe I am not understanding what you are saying, but I would presume that I have added it to the Data Fields as I can select it as a Merge Field from within Word?

  • Community Member Profile Picture
    on at
    RE: Syntax Error! Calculating Mail Merge Fields

    IT seems that calculate merge fields in Word only works with whole number fields and not any fields that have formatting (eg. Currency; Decimal or Text). Does anyone have a solution around this, other than changing all the fields I want to calculate in the Mail Merge to Whole Numbers?

    If I change the Fields, then how do I apply the Formatting in CRM to chow as Currancy with Decimal places on a Whole Number field?

  • Dr401k Profile Picture
    on at
    RE: Syntax Error! Calculating Mail Merge Fields

    Andrea, the problem occurs because of the currency formatting, which is native to your data element Setup__Once_Off_Fee.  Within your Microsoft Word Mail Merge Document, you should remove the currency formatting for the calculation.  You can always re-apply the currency format after the calculation has been completed.  Let me know if the following works: {= {MERGEFIELD Setup__Once_Off_Fee \#0} *1.14 \# $0.00}

  • Dan Parkman Profile Picture
    on at
    RE: Syntax Error! Calculating Mail Merge Fields

    That resolved the problem for me, thanks very much for your help!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans