09 August 2016

Dynamics AX HTML decode

When you need to decode HTML strings that are escaped like & l t ; xml & g t ; in X++ there are several ways.
In general I would recommend calling

System.Web.HttpUtility::HtmlDecode(yourHTMLorXMLorWhatever);

that should do the work. If not there is another static method that could be used:

SysEmailTable::htmlDecode(yourHTMLorXMLorWhatever);

This method is using strReplace operations to decode the most common characters.

No comments: