Thursday, May 20, 2010

It's the little things...

You know, when it comes to EP dev, it’s nice when something goes right or at least gets fixed. It really irked me that 64-bit versions of EP get the shaft and one missing feature was the auto-deploy of updated web controls from visual studio (which worked lovely in 32-bit environments).

Mey (author of Solutions Monkey, the Oracle of EP dev) updated the developers cookbook on his blog earlier this year. And there’s a lovely piece right at the end how to get this feature working in 64-bit.

http://blogs.msdn.com/epblog/archive/2010/01/05/ax-2009-ep-development-cookbook.aspx

Some peace has been restored to the planet.

Friday, September 4, 2009

New Dimension breaks EP

When adding a new dimension to an entity that is exposed in EP, you must recompile the datasets in the AOT lest you get “object reference” errors on the method Microsoft.Dynamics.Framework.Data.Ax.DataSetViewRow.GetFieldValue.

See resolution posted by user on the newsgroup here:

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.axapta&tid=b7dd118d-70c5-40c0-98a6-b5086ce51817&cat=en_US_c19bf0af-8048-4074-a429-02d7e737ea49&lang=en&cr=US&sloc=&p=1

Missing BC Proxy Account after EP Setup

I’m not sure what exactly caused this scenario, but after re-running setup (with proper credentials) and having setup indicate it was completed successfully, we could not load and EP content.  The sharepoint site loaded just fine, however the error shown below was also in the event log. 

It turns out the BC account was not specified in AX:

Admin > Setup > Security > System service accounts

Be sure the Business Connector Proxy contains the user name and the domain for the BC proxy account.

 

Log Name:      Application
Source:        Microsoft.Dynamics.Framework.BusinessConnector
Date:          9/4/2009 12:01:01 PM
Event ID:      1000
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      <MACHINE.FQDN>
Description:
Dynamics Adapter LogonAs failed.

Logon error : Unable to log on to Microsoft Dynamics AX.

Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException
   at Microsoft.Dynamics.BusinessConnectorNet.Axapta.Logon(BC_PROXY_ACCOUNT_INFO* pBCProxyAccountInfo, String company, String language, String objectServer, String configuration)
   at Microsoft.Dynamics.BusinessConnectorNet.Axapta.LogonUsingBCProxyAccount(_SEC_WINNT_AUTH_IDENTITY_W* pImpersonatedUserAccount, NetworkCredential bcProxyCredentials, String company, String language, String objectServer, String configuration)
   at Microsoft.Dynamics.BusinessConnectorNet.Axapta.LogonAs(String user, String domain, NetworkCredential bcProxyCredentials, String company, String language, String objectServer, String configuration)
   at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsAdapter.LogonAs(String user, String domain, NetworkCredential bcProxyCredentials, String company, String language, String objectServer, String configuration)

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft.Dynamics.Framework.BusinessConnector" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2009-09-04T16:01:01.000Z" />
    <EventRecordID>172877</EventRecordID>
    <Channel>Application</Channel>
    <Computer><MACHINE.FQDN></Computer>
    <Security />
  </System>
  <EventData>
    <Data>Dynamics Adapter LogonAs failed.

Logon error : Unable to log on to Microsoft Dynamics AX.

Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException
   at Microsoft.Dynamics.BusinessConnectorNet.Axapta.Logon(BC_PROXY_ACCOUNT_INFO* pBCProxyAccountInfo, String company, String language, String objectServer, String configuration)
   at Microsoft.Dynamics.BusinessConnectorNet.Axapta.LogonUsingBCProxyAccount(_SEC_WINNT_AUTH_IDENTITY_W* pImpersonatedUserAccount, NetworkCredential bcProxyCredentials, String company, String language, String objectServer, String configuration)
   at Microsoft.Dynamics.BusinessConnectorNet.Axapta.LogonAs(String user, String domain, NetworkCredential bcProxyCredentials, String company, String language, String objectServer, String configuration)
   at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsAdapter.LogonAs(String user, String domain, NetworkCredential bcProxyCredentials, String company, String language, String objectServer, String configuration)

</Data>
  </EventData>
</Event>

Dynamics AX 2009 Setup Logs

I often forget where the setup logs go when running the AX Setup.  This is the default folder for setup logs:

 

C:\ProgramData\Microsoft\Dynamics AX\Dynamics AX Setup Logs

Friday, August 21, 2009

AxUpdatePortal failures and axwebparts.cab

A while back we opened a support ticket regarding the use of the AxUpdatePortal utility (which is the only way to update EP in a 64-bit environment after SP1). This post summarizes the role of the axwebparts.cab, how misuse of the AxUpdatePortal utility can "break" EP and the way to resolve the issue when it does occur.

In extreme circumstances, it is required to re-run setup for EP, which is slow, but once you are familiar with the steps, you can reliably use AxUpdatePortal.

http://blogs.msdn.com/emeadaxsupport/archive/2009/07/23/axupdateportal-exe-does-not-update-enterprise-portal-when-not-running-from-an-elevated-command-prompt.aspx

Tuesday, May 12, 2009

MetadataNodeNotFoundException

If you encounter a “MetadataNodeNotFoundException” on any EP page you load, there is likely something up with your Web Menus. A number of postings indicate “Check your Web Menu” or something useful to that effect. In our case we have a few developers and the AOD hadn’t been refreshed for a day or so. It took a little thinking, but looking at the Application Object list in the client and looking for any Web Controls, Web Menus, Web Menu Items or Web Modules that had changed helped us discover it was a web module:

In our case a new Web Module had been created by a developer that had no associated menus which caused the whole app to break. Unfortunately the error wasn’t terribly helpful or easy to interpret but we resolved the issue taking a step back to first principles and seeing what had changed recently. We didn't have source control in place at the time, though it likely would have more quickly identified recent changes to see what might have caused the break.

Perhaps not intuitive, however, as one might think that creating an empty web module might simply result in an empty site or at worst the web module not being loaded. Not so. In my experience many errors come from unintuitive sources and this is why this blog and others exist - to help the next poor virgin.

Wednesday, April 15, 2009

AxLabel issues in Visual Studio

Getting build errors in Visual Studio when you try to use AxLabels in your markup? You are probably missing the AxLabel expression type in your web.config. Modify your web.config to include the expressions as below. They are in the <system.web><compilation> node. The following was copied from the web.config of the root EP virtual directory:

<expressionBuilders>
<remove expressionPrefix="Resources" />
<add expressionPrefix="Resources" type="Microsoft.SharePoint.SPResourceExpressionBuilder, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<add expressionPrefix="SPHtmlEncodedResources" type="Microsoft.SharePoint.SPHtmlEncodedResourceExpressionBuilder, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<add expressionPrefix="SPSimpleFormattingEncodedResources" type="Microsoft.SharePoint.SPSimpleFormattingEncodedResourceExpressionBuilder, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<add expressionPrefix="AxLabel" type="Microsoft.Dynamics.Framework.Portal.UI.Labels, Microsoft.Dynamics.Framework.Portal, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add expressionPrefix="AxDataSet" type="Microsoft.Dynamics.Framework.Portal.UI.AxDataSetExpressionBuilder, Microsoft.Dynamics.Framework.Portal, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add expressionPrefix="AxEnum" type="Microsoft.Dynamics.Framework.Portal.UI.AxEnumExpressionBuilder, Microsoft.Dynamics.Framework.Portal, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add expressionPrefix="AxEDT" type="Microsoft.Dynamics.Framework.Portal.UI.AxEDTExpressionBuilder, Microsoft.Dynamics.Framework.Portal, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</expressionBuilders>