Tuesday 17 February 2015

Using the infolog in the Enterprise Portal ax 2012

In the portal you can access the infolog by using the Proxy of the Enterprise Portal.

using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;
Proxy.Info objInfoLog = new Proxy.Info(this.AxSession.AxaptaAdapter);

Now, when you want to write something to the infolog you need to give a Enum with it,
so the portal knows if the message you want to show is a info, warning or error.
So pass through Proxy.Exception.Info, Proxy.Exception.Warning or Proxy.Exception.Error.

1.objInfoLog.add(Proxy.Exception.Warning, "My warning");

So in short thing you should keep in mind while using the Infolog-class:
Use short & informative messages
Choose the righty message level (info, warning, error)
Use actions, this simple trick is verry usefull for end-users
Limit the number of messages you send to the Infolog-dialog

No comments:

Post a Comment