'To field contains unresolved placeholders' error message

Occasionally, our customers report error messages like the following when executing reports configured with the Email Print Destination:

  • To field (@Remit to@) contains unresolved placeholders.

Explanation

As SSRS prepares the report data source, it also resolves Print management email tokens. If the token is not resolved, it stays as a part of the To field in the Print Destination. Much later in the pipeline, when Docentric kicks in, and the logic for resolving placeholders is reached, the tokens that are left unresolved are considered as placeholders, hence the message.
To make sure that the problem is in standard, you can use the SSRS Email print destination with this token, and you will get the error that the To field is empty.

Solution

The first thing to check is that the name of the email token is not typed incorrectly. It is better to pick the token from the available lookups rather than to manually type it.

Next, make sure that the report is actually being printed through Print Management, rather than Original/Copy preview, since these tokens are Print Management email tokens, and are only resolved correctly when printing through Print Management.

If a report isn’t recognized as a Print Management report, D365FO won’t go into the processing part where email tokens are being resolved, so the email address will still contain just the @<placeholder_name>@ substring, instead of its replacement (the actual email address).

Another thing to keep in mind is that if the purpose email token is used, it must have the Description field translated in all user languages. For example, if user with user language ‘de’ prints a report where a purpose email token is used, and the purpose doesn’t have the Description translated in ‘de’, there will be a runtime error. Because the token won’t be resolved, it will reach our placeholder-resolving logic, which will also fail, and the final error will be: “To field contains unresolved placeholders”. The error will be raised by Docentric, but the real cause is invalid purpose setup (standard).

The missing translation issue won’t appear if you are using some of the out-of-the-box purposes, because they have the translations already. If you create your own purposes, the translations don’t exist in other languages and in such case, you get the error when you try to use the purpose for email address resolution.