Wednesday 9 October 2013

WCF settings error on new AX 2012 AOS installation

It is quite common to have a few different instance installed at Development machine. Sometimes developer make a duplicate copy of client's LIVE environment just to test out some hotfix. Below is one of the scenario which cause the error - "The specified client configuration does not contain valid WCF settings".
  1. Backup an AX 2012 database
  2. Restore as another database name
  3. Install a new AOS instance at another machine
  4. Configure this new AOS to point to the database restored at Step #2
  5. Start up AOS and login to AX
  6. The error "The specified client configuration does not contain valid WCF settings" pops up
Trying to create sales order will throw error (so does a lot of other functionality).

*During the creation of this new instance, the CIL is not recompile

To fix this:
  1. Run a Full CIL generation
  2. On the AX Client Configuration Utility, update the config using Configure Services


Thursday 3 October 2013

Sales orders cannot be rearranged when individual sales orders are tax regulated

Another quick note regarding tax regulation error.

Posting
+-- Tax regulations are found
 |   +-- Tax is regulated on sales order ID 008-SOD00163199
 |   +-- Sales orders cannot be rearranged when individual sales orders are tax regulated.
 |   +-- Remove the regulation on the orders, rearrange and regulate the tax on the summary order.
+-- Update has been cancelled because of an error.




Example
1. An order is created
2. User manually alter the tax [Sales/Purchase order (form) > Sell/Purchase (tab) > Tax (group) > VAT]
3. Posted invoice
4. Added new line to the order
5. Post invoice and error occur

Resolution
As indicated in the error message, reset the tax
1. Go to Sales/Purchase order (form) > Sell/Purchase (tab) > Tax (group) > VAT
2. Click on the "Adjustment" tab
3. Click on the "Reset actuals to calculated" and close the form
4. Proceed to invoice the order, adjust the tax in the posting form (VAT button on the right) before post it

Turn on IncludeExceptionDetailInFaults for service error in Dynamics AX

Just a quick post regarding turning on IncludeExceptionDetailInFaults for service error in Dynamics AX 2012. I'm using SOAPUI for the services testing and hit an error as below.

Error (before turn on IncludeExceptionDetailInFaults)
The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.


Turn on IncludeExceptionDetailInFaults
Identify the service you're testing, then go to the path below (replace the <ServiceName> with the service name).
C:\Program Files\Microsoft Dynamics AX\60\AifWebServices\<ServiceName>\web.config
*If you installation is not at the default location, you'll have to change the path to your installation path

Open the file and search for the text 'includeExceptionDetailInFaults', then set it to true.


Error (after turn on IncludeExceptionDetailInFaults)
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
   <s:Body> 
      <s:Fault> 
         <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
         <faultstring xml:lang="en-GB">No matching MessageFilter was found for the given Message.</faultstring> 
         <detail> 
            <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
               <HelpLink i:nil="true"/> 
               <InnerException i:nil="true"/> 
               <Message>No matching MessageFilter was found for the given Message.</Message> 
               <StackTrace>at System.ServiceModel.Routing.MessageRpc.RouteToSingleEndpoint[TContract](RoutingConfiguration routingConfig)
   at System.ServiceModel.Routing.ProcessRequestAsyncResult`1..ctor(RoutingService service, Message message, AsyncCallback callback, Object state)
   at System.ServiceModel.Routing.RoutingService.BeginProcessRequest[TContract](Message message, AsyncCallback callback, Object state)
   at System.ServiceModel.Routing.RoutingService.System.ServiceModel.Routing.IRequestReplyRouter.BeginProcessRequest(Message message, AsyncCallback callback, Object state)
   at AsyncInvokeBeginBeginProcessRequest(Object , Object[] , AsyncCallback , Object ) 
   at System.ServiceModel.Dispatcher.AsyncMethodInvoker.InvokeBegin(Object instance, Object[] inputs, AsyncCallback callback, Object state)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) 
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) 
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) 
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> 
               <Type>System.InvalidOperationException</Type> 
            </ExceptionDetail> 
         </detail> 
      </s:Fault> 
   </s:Body> 
</s:Envelope>