How to create Dynamics AX managed Enterprise Portal advertisment webpart?

Problem.

I was customizing a few Enterprise Portal pages and there was a requirement to create a section responsible for displaying image or gif with advertisment. As it is a simple image or gif file, I assumed that it would be easier for key users to change them at Microsoft Dynamics AX level, not at Enterprise Portal level.

Tool.

I added four new fields in ECPParameters table, which are defining href attribute (NavigateUrl), img src attirubte (ImageUrl), width and height. After that I created a regular EP User Control named EPAdvertisment (here is LINK to Microsoft Docs). I am retriving image details from Microsoft Dynamics AX2012 and dynamically building our content.

Step by step.

What we have to do is:

  1. Create fields in ECPParamters table to define image href attribute, image src attribute and it’s size.

    How to create Dynamics AX managed Enterprise Portal advertisment webpart?
    How to create Dynamics AX managed Enterprise Portal advertisment webpart?
  2. As always, to see changes in Visual Studio, you will probably have to generate incremental CIL, regenerate proxies etc.
  3. Create new EP User Control named Advertisment. And let’s prepare our code to display our image.
  4. Advertisement.ascx
  5. Advertisement.ascx.cs

Leave a Reply