Wednesday, May 23, 2012

Dynamic Role Assignment

Another very powerful feature of AX2012 is the automatic assignment of security roles to users based on certain criteria. A security administrator can select rule in "Assign users to roles" form against a particular role. A rule is actually an AOT query that can be created with the help of a developer. An special thing about the query is that the it is modeled with UserInfo table as the first datasource. Dynamic role assignment helps in scenarios where employees are promoted to a different title or designation, in case of inter departmental transfers or when new employees are taken on board.

Tuesday, May 8, 2012

Management Reporter Services

You might have noticed installation wizard asking for two services while installing Management Reporter server component. The application service is used by MR clients to connect with server and access the MR data. While the process service is used to generate reports that MR clients push to report queue.

Thursday, May 3, 2012

Cannot logon to Dynamics AX...getting this error when trying to consume Customer AIF service..Cont

Alright, so the second exception I was getting on Customer service create() method was due to the fact that I did not set the correct Delivery mode in Sales and marketing module of AX 2012.

If anyone needs the customer AIF service code that takes data from a CSV file and load it to AX, please feel free to contact me. I do have the code available for Vendor and Item master.

Wednesday, May 2, 2012

Disable development workspace - AX 2012

In order to disable the development workspace in MS Dynamics AX 2012, you need to delete the license codes for the following:

1. Remove Product Builder's license code in Feature sets tab.

2. X++ Source Code

3. Enable license code authoring and editing

4. Windows Morphx Development Suite

It will synchronize on closing the license info form. Let it do it. Then re-launch the client which will present disabled Dev workspace. Make sure to back up the CUS and USR layer code as removing the license codes will also remove any custom code on these layers.

Cannot logon to Dynamics AX...getting this error when trying to consume Customer AIF service

Today, I was writing C# code to consume out of the box customer service to create customers from a CSV file. Everything worked quite ok but when the create() method of customer service was called, I got the logon failure message. Further, the event viewer gave the following information:


    Object Server 01:
    An error has occurred in the services framework.  Method: AifMessageInspector::AfterReceiveRequest.  Error: System.ServiceModel.FaultException: Failed to logon to Microsoft Dynamics AX.
   at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.InitializeSession()
   at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.InitializeContext()
   at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.Attach(OperationContext owner)
   at System.ServiceModel.ExtensionCollection`1.InsertItem(Int32 index, IExtension`1 item)
   at System.Collections.Generic.SynchronizedCollection`1.Add(T item)
   at Microsoft.Dynamics.Ax.Services.AifMessageInspector.AfterReceiveRequest(Message& request, IClientChannel channel, InstanceContext instanceContext)

 


After I looked at some blog posts, I tried to refresh the WCF services from client configuration. After applying the changes, I ran the C# code and luckily this time the Logon failure was no longer there. However, I got another exception with the following details:

System.ServiceModel.FaultException`1 was unhandled
  Message=Request Failed. See the Exception Log for details.
  Source=mscorlib
  Action=http://schemas.microsoft.com/dynamics/2008/01/services/CustomerService/createAifFaultFault
  StackTrace:
    Server stack trace:
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at CustomerServices.ServiceReference1.CustomerService.create(CustomerServiceCreateRequest request)
       at CustomerServices.ServiceReference1.CustomerServiceClient.CustomerServices.ServiceReference1.CustomerService.create(CustomerServiceCreateRequest request) in c:\users\imran.rana\documents\visual studio 2010\Projects\CustomerServices\CustomerServices\Service References\ServiceReference1\Reference.cs:line 9063
       at CustomerServices.ServiceReference1.CustomerServiceClient.create(CallContext CallContext, AxdCustomer Customer) in c:\users\imran.rana\documents\visual studio 2010\Projects\CustomerServices\CustomerServices\Service References\ServiceReference1\Reference.cs:line 9070
       at CustomerServices.Program.Main(String[] args) in c:\users\imran.rana\documents\visual studio 2010\Projects\CustomerServices\CustomerServices\Program.cs:line 139
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

At this point, I am trying to figure out what went wrong. Readers may try the first option as they might not be getting the second exception as I am.