How to display the Country/State description instead of the Country/State IDs without changing the DSP class?

Hi, we are working on customer facing documentation in Europe. The country and state IDs are in the DSP however the descriptions for country and state are not included. Is there any easy way to include the descriptions without modifying all of the DSPs? Thanks!

Example: CountryRegionId=‘IRL’ but the description ‘Ireland’ is not available.

Hi,

Thank you for your question. The optimal way to go about your requirement depends on the number of countries/states in question.

Technically, you could fulfill your requirement with Docentric by using multiple nested inline if functions (iif). This is an excellent option in you’re only planning on writing the expression for a few countries/states, as you don’t need the development team and the expression would be relatively simple.

To showcase the nested inline IF expression, I’ve created an Inline IF test template.docx. In my example, I wanted to write a custom text depending on the Currency Code. The expression to achieve the output visible on the screenshot below was:

iif(@CurrencyCode = ‘EUR’, ‘This is in EURO’,
iif(@CurrencyCode = ‘USD’, ‘This is in US dollars’,
iif(@CurrencyCode = ‘AUD’, ‘This is in Australian dollars’, ‘This is in another currency’)))

Still, if you are planning on writing the expression for all European countries, despite the fact that Docentric can support it, the expression would be extremely complicated, and hard to maintain. In that case, I recommend adjusting the DSP class to include the country and state description instead.

Hope this helps,

Eva

Inline IF test template.docx (51.3 KB)

Thanks for the quick response.

No problem, we’re always happy to help! :slight_smile:

Eva, I found a solution to this issue in the D365 Global address book, address format settings. There are ‘Expand’ fields for country/region and State/province. Once these are checked the text description is used instead of the ID example ‘Ireland’ is used on addresses instead of ‘IRL’. There is also an ‘Update addresses’ job on the menu that will update the postal address format for addresses that use the format being updated. Hopefully this help someone else hitting this issue.

1 Like

Hi,

Thanks so much for sharing this tip! This will surely come in handy to many D365FO users (including us) out there. Great contribution!