Export (0) Print
Expand All

Using the Infolog

Dynamics AX 2009

As you add code to User Controls, you may have situations that require communicating important information to the user. Do this by sending a message to the Infolog that is displayed on the page. The Infolog can be a separate Web part on the page, or it can be included as a component in a User Control.

The Infolog is accessed through the proxy for Enterprise Portal. To access resources from the proxy, you must have added the generated proxies to your User Control project. You must also add the following reference to your code so the items in the proxy can be accessed.

using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;

For more information about generating and using the proxy, see Proxies.

You must create an instance of the Info object to be able to work with the Infolog. This is shown in the following example.

Proxy.Info objInfoLog = new Proxy.Info(this.AxSession.AxaptaAdapter);

Several message types can be written to the Infolog. The Exception enumeration defined in the Enterprise Portal proxy defines the various types. The most common message types are listed in the following table.

Error type

Enumeration value

Information

Exception.Info

Warning

Exception.Warning

Error

Exception.Error

To add a message to the Infolog, use the add() method for the Info object. The following example adds a warning message to the Infolog.

objInfoLog.add(Proxy.Exception.Warning, "This is a warning sent to the Infolog");

When you add a message to the Infolog, any messages that are currently displayed will remain. This allows for the Infolog to display multiple messages at the same time. To clear the Infolog of any messages that have been added to it, use the clear() method for the Info object. The following example clears the Infolog.

objInfoLog.clear(0);

Community Additions

ADD
Show:
© 2014 Microsoft