Tuesday, 12 May 2015

Dynamics AX EP Install issue : ISAPI Filter ‘C:\Windows\Microsoft.NET\Framework\v4.0.30319\\aspnet_filter.dll’ could not be loaded due to a configuration problem

EP Issue from Event viewer.

ISAPI Filter ‘C:\Windows\Microsoft.NET\Framework\v4.0.30319\\aspnet_filter.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a AMD64 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.



Solution

Upon closer inspection of the error message I noticed the problem:


v4.0.30319\\aspnet_filter.dll

Windows doesn’t handle double slashes very well as opposed to Linux. What is strange is none of these settings are manually changed which suggests it was perhaps a Windows update that caused this, however I have no evidence beyond change control logs.

I fixed with the following process:


Opened IIS Manager and selected the IIS web server node:




In the middle pane, browse to the IIS section and select ISAPI Filters:




Expand the columns as required, looking for an Executable path with \\ in it, then click Edit:





From the above screenshot, change the \\ to \ so the path reads:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll

Dynamics AX Enterprise portal issue: Exception occurred on the metadata service on client or server. See exception details below:>Thread was being aborted.

EP Issue

An error has occurred while redirecting to the default home page set for the Enterprise Portal site http://****:14841/sites/DynamicsAx.  Microsoft Dynamics AX is ignoring this error and redirecting to default.aspx.
Exception occurred on the metadata service on client or server. See exception details below:
>Thread was being aborted.
Microsoft.Dynamics.AX.Framework.Services.Client.MetadataServiceException
   at Microsoft.Dynamics.AX.Framework.Services.Client.ServiceClientHelper.InvokeChannelOperation[TResult,TChannel](IServiceClient`1 client, Func`2 operationInvoker, Func`2 exceptionWrapper)
   at Microsoft.Dynamics.AX.Framework.Services.Client.MetadataServiceProxyFactory.<>c__DisplayClass54.<CreateWebMenuItemMetadataProxy>b__52()
   at Microsoft.Dynamics.AX.Framework.Services.Client.MetadataServiceProxyFactory.CreateWebMenuItemMetadataProxy(WebMenuItemKey webMenuItemKey)
   at Microsoft.Dynamics.AX.Framework.Services.Client.MetadataCache.<.cctor>b__46(String mainKey)
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.MetadataAccessorBase`2.GetItem(TKey key)
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Caching.ItemCache`2.<>c__DisplayClassc.<GetItemCustom>b__b()
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Caching.CacheBase.CacheRead(ICacheReadArgs cacheReadArgs, Action tryReadAction, Action readThroughAction)
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Caching.ItemCache`2.GetItemCustom(TKey key, Func`2 itemAccessor)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebMenuItemMetadata.GetWebMenuItemReferenceNode[T](ISession session, SysDictMenu menuItemReference)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebMenuMetadata.InitializeChildren(ISession session, SysDictMenu dictMenu, WebMenuMetadata webMenu)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebMenuMetadata.GetWebMenuMetadata(ISession session, SysDictMenu dictMenu, Boolean subMenu)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebMenuMetadata.InitializeChildren(ISession session, SysDictMenu dictMenu, WebMenuMetadata webMenu)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebMenuMetadata.GetWebMenuMetadata(ISession session, SysDictMenu dictMenu, Boolean subMenu)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebMenuMetadata.InitializeChildren(ISession session, SysDictMenu dictMenu, WebMenuMetadata webMenu)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebMenuMetadata.GetWebMenuMetadata(ISession session, SysDictMenu dictMenu, Boolean subMenu)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebMenuMetadata.GetWebMenuMetadata(ISession session, String webMenuName)
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Caching.ItemCache`2.<>c__DisplayClassc.<GetItemCustom>b__b()
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Caching.CacheBase.CacheRead(ICacheReadArgs cacheReadArgs, Action tryReadAction, Action readThroughAction)
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Caching.ItemCache`2.GetItemCustom(TKey key, Func`2 itemAccessor)
   at Microsoft.Dynamics.AX.Framework.Services.Client.MetadataCache.GetWebMenuMetadata(ISession session, String webMenuName)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebModuleMetadata.GetWebModuleMetadata(ISession session, SysDictMenu dictMenu, Boolean subModule)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebModuleMetadata.InitializeChildren(ISession session, SysDictMenu dictMenu, WebModuleMetadata webModule)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebModuleMetadata.GetWebModuleMetadata(ISession session, SysDictMenu dictMenu, Boolean subModule)
   at Microsoft.Dynamics.AX.Framework.Services.Client.WebModuleMetadata.GetWebModuleMetadata(ISession session, String webModulePath)
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Caching.ItemCache`2.<>c__DisplayClassc.<GetItemCustom>b__b()
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Caching.CacheBase.CacheRead(ICacheReadArgs cacheReadArgs, Action tryReadAction, Action readThroughAction)
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Caching.ItemCache`2.GetItemCustom(TKey key, Func`2 itemAccessor)
   at Microsoft.Dynamics.AX.Framework.Services.Client.MetadataCache.GetWebModuleMetadata(ISession session, String webModulePath)
   at Microsoft.Dynamics.Framework.Portal.UI.WebControls.MasterPageControl.FindRedirectPageForModule(ISession session, String& redirectMenuItemForModule)
   at Microsoft.Dynamics.Framework.Portal.UI.WebControls.MasterPageControl.RedirectToHomePageAndCompany(SPWeb site)
Thread was being aborted.
System.Threading.ThreadAbortException
   at System.Runtime.InteropServices.Marshal.CopyToManaged(IntPtr source, Object destination, Int32 startIndex, Int32 length)
   at System.Net.SafeDeleteContext.InitializeSecurityContext(SecurDll dll, SafeFreeCredentials& inCredentials, SafeDeleteContext& refContext, String targetName, ContextFlags inFlags, Endianness endianness, SecurityBuffer inSecBuffer, SecurityBuffer[] inSecBuffers, SecurityBuffer outSecBuffer, ContextFlags& outFlags)
   at System.Net.SSPIAuthType.InitializeSecurityContext(SafeFreeCredentials credential, SafeDeleteContext& context, String targetName, ContextFlags inFlags, Endianness endianness, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer, ContextFlags& outFlags)
   at System.Net.SSPIWrapper.InitializeSecurityContext(SSPIInterface SecModule, SafeFreeCredentials credential, SafeDeleteContext& context, String targetName, ContextFlags inFlags, Endianness datarep, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer, ContextFlags& outFlags)
   at System.Net.NTAuthentication.GetOutgoingBlob(Byte[] incomingBlob, Boolean throwOnError, SecurityStatus& statusCode)
   at System.Net.Security.NegoState.GetOutgoingBlob(Byte[] incomingBlob, Win32Exception& e)
   at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.CheckCompletionBeforeNextSend(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.ProcessReceivedBlob(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
   at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
   at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)
   at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Dynamics.AX.Framework.Services.Metadata.Service.IAxMetadataService.GetWebMenuItemMetadata(WebMenuItemKey[] menuItemKey)
   at Microsoft.Dynamics.AX.Framework.Services.Client.ServiceClientHelper.InvokeChannelOperation[TResult,TChannel](IServiceClient`1 client, Func`2 operationInvoker, Func`2 exceptionWrapper)



Resolution
Change connection time-out properties in the web.config file
1.    In a basic text editor such as Notepad, open the web.config file for example %SYSTEMDRIVE%\Inetpub\wwwroot 
-or- 
%SYSTEMDRIVE%\\Inetpub\wwwroot\wss\VirtualDirectories\
14841
folder (Here 14841 is my port folder)
1.    Press CTRL + F to open the Find dialog box.
2.    Find the following tag:
<httpRuntime maxRequestLength="51200" />
3.    Replace it with this tag:
<httpRuntime executionTimeout="6000" maxRequestLength="51200" />
4.    Find the following tag (you might have to search from the beginning of the file):
</sectionGroup>
5.    Add the following tags on new lines after the </sectionGroup> tag:
<sectionGroup name="DynamicsAX">
<section name="Deployment" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
6.    Find the following tag:
</SharePoint>
7.    Add the following tags on new lines after the </SharePoint> tag:
<DynamicsAX>
<Deployment SiteCreationTimeOut="1200" />
</DynamicsAX>
8.    Save your changes, and close the web.config file.
9.    At the command prompt, type iisreset, and then press ENTER.





Wednesday, 25 March 2015

Get default dimension for a Main account id

Use the below code to get default dimension for any main account id


static void getDefDimMainAccId(Args _args)
{
    RefRecId    defDim;

    defDim = DimensionStorage::getDefaultAccountForMainAccountNum('10000');
 
     info(int642str(defDim ));

}


Wednesday, 18 March 2015

Default a string value in DMF AX 2012 (Instead of creating a generate methods or hardcode in design)

Last week when i was doing an import for employee entity, my analyst told that customer won't provide email description in import file and it was just a textual description which was common throughout my DMF import. First i thought to write a generate method (which is again a time consuming option), then i found an easier way to do it. DMF has build in functionality to pass a constant string/default value. To do that

Steps

1. Go to Processing groups form.
2. Select the entity for which you have pass default value and click Entites.



3. In the Entites screen select modify source mapping.

4. Follow the step in below image

5. Provide default staging value in below screen



6. Click Ok.

That will add your text value in staging.

Happy day :)


Wednesday, 11 March 2015

How RECID is generated in AX 2012 ?

In AX 2012 RECID is created by a store procedure in which is available your transaction database (not model database). The name of the store procedure is sp_GetNextRecId.



Now you can use the same SP to create RECID.  

Friday, 6 March 2015

DMF error "INVALID FUNCTION NAME" while doing Modify target mapping in AX 2012(Custom method added to base entity)

I have created a custom generate method in existing employee entity for DMF . The method what i created was generateNino(). But while modifying target mapping in Target entity form i was getting infolog with following error.


"Invalid function name: generateNino"


Solution:

Just restart the AOS services and try to run Modify target mapping.

Monday, 2 March 2015

Error When open Data Import \ Export parameters screen


When an user open Data Import \ Export  parameters screen, system raises the following error:
"Assembly containing type Microsoft.Dynamics.AX.DMF.ServiceProxy.DmfEntityProxy is not referenced"
"Object CLR object could not be created"
and this issue appeared only when database server is not the same as AOS server.

Step to Resolve
1.  Make sure Microsoft Dynamics AX Data Import/Export Framework Service and AOS server (Microsoft Dynamics AX Object Server 6XXXX-MicrosoftDynamicsAX) has the same service account.

2. Go to Local users and group and Add the same service account to Microsoft Dynamics AX Data Import Export Framework Service Users group. This group folder exist only on system where you have installed "Microsoft Dynamics AX Data Import/Export Framework Service " and not on AOS

3.  Restart the sytem which has Microsoft Dynamics AX Data Import/Export Framework Service .

4. Post any issue exist.