Wednesday, September 30, 2015

SSRS and Array Fields

I recently had a requirement to show amounts throughout different months of the year.  Originally, I only was showing 3 months, however, the requirement changed and all 12 months were then required.

This led me to try using and EDT with the Array Elements set up. Very easy on the AX side, however, I wasn't sure how SSRS would handle it.  I added the new array field to my report table and refreshed my dataset in SSRS and POOF!  It worked great.

SSRS sees the array numbering as 0-11 rather than 1-12 like AX.

Pleasantly surprised!

Although, I have noticed that no values are coming through to the report.

Also, to clarify, when using code I think ax uses[0-11], however, the EDT in the AOT appears to use 1-12.

SSRS is acting funny... It doesn't put MyArrayField[1] into the corresponding datasat SSRS Field MyArrayField1

https://community.dynamics.com/ax/f/33/t/177552

Tuesday, October 14, 2014

DIXF timeout issues

DIXF - Interesting find

I spent the past 2 weeks doing data migration and here are some interesting errors I found and how to fix them:

Several issues can be seen with large amounts of records (more than 200k - 300k) and medium amounts of records (around 200k) with a lot of data.
Here is the error:

System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to http://myServer:7000/DMFService/DMFServiceHelper.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host 
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) 
--- End of inner exception stack trace --- 
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) 
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) 
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) 
--- End of inner exception stack trace --- 
at System.Net.HttpWebRequest.GetResponse() 
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 
--- End of inner exception stack trace --- 

Server stack trace: 
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) 
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) 
at System.ServiceModel.Channels.ClientReliableChannelBinder`1.RequestClientReliableChannelBinder`1.OnRequest(TRequestChannel channel, Message message, TimeSpan timeout, MaskingMode maskingMode) 
at System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode) 
at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout) 
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 Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.DMFServiceReference.ServiceContract.ShowPreview(DMFEntity entity) 
at Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.DmfEntityProxy.DoWork[T](Func`1 work)


We solve this by adding 'recieveTimeout' and 'sendTimeout' into the C:\Program Files\Microsoft Dynamics AX\60\DataImportExportFramework/Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.exe.config


<bindings>
      <wsHttpBinding>
        <binding name="DMFService_WsHttpBinding" receiveTimeout="01:00:00"
sendTimeout="01:00:00"
          maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647"             maxNameTableCharCount="2147483647" />
        </binding>
      </wsHttpBinding>
    </bindings>

Thursday, September 18, 2014

Check if user has access set up on a menu item

Recently I was working on a project where I needed to check if the user had security access to a Menu Item.  The menu item wasn't being used, but it had the security access that I wanted to check.

Very simply, I was able to use this:

Global::hasMenuItemAccess(...);

Worked great!

Thursday, August 14, 2014

Recently I was working on a project where I was calling into a class and I needed to verify the record that was coming in.  Here is how I did it:

public static void main(Args _args)
{
    MyClass                                myClass;
    RefRecId                                bankChequeTableRecId;
    FormDataSource                          formDataSource;
    ;

    myClass= MyClass::construct();
    if (_args != null && _args.dataSet() == tablenum(BankChequeTable) && _args.record().RecId != 0)
    {
        BankChequeTableRecId = _args.record().RecId;
        if (_args.record().IsFormDataSource() == true)
        {
            FormDataSource = _args.record().dataSource();
        }
    }
    if (BankChequeTableRecId != 0)
    {
        myClass.ToggleEditForAvidSync(BankChequeTableRecId);
    }
    if (formDataSource != null)
    {
        FormDataSource.research(true);
    }
}

Basically I am checking
1. _args has something
2. _args.dataSet() - Checking if this args is a BankChequeTable record
3. _args.record().RecId - Making sure there is a record in the args
4. Setting my RecId variable to the recid passed in by args.
5. _args.record().IsFormDataSource() - I want to know if this is a form data source and later one refresh that datasource.

I have needed this a lot so I thought I would post it up!

Friday, July 18, 2014

Add new Financial Dimension backing entity

Under General ledger -> Setup -> Financial dimensions, open the Financial dimensions form.  If you create a new dimension there is a list of 'Use values from'.  These are the backing entities that you can use values from.  I had a project to add something to this list.  

Rather than type everything out, here is the link to a post I found that gives a perfect description of how to accomplish this. 

Thanks!

Wednesday, June 18, 2014

SalesLine and Financial Dimensions

I was working with the SalesLine recently and needed a custom Financial Dimension added.  I found this great blog post that explains exactly how to do it:

http://www.intergen.co.nz/blog/tim-schofield/dates/2011/12/how-to-add-a-financial-dimension-in-ax-2012/


Wednesday, May 14, 2014

AX 2009 Compare form colors

I have been working a bit in AX 2009 lately and have found that the colors when comparing two objects, do not work.  A quick google search turned up this blog post:


Very good explanation of why and how to fix it.