Friday, December 29, 2017

Illegal entry in an array.

I have an issue that is returning a very strange error from Enterprise Portal.
Initially I receive the following in my browser:

An unhandled error has occurred. To view details about this error, enable debugging in the web.config file or view the Windows event logs.

Upon checking the event viewer on the EP IIS machine, I see the following:

An unhandled error has occurred. To view details about this error, enable debugging in the web.config file or view the Windows event logs.

Error executing code: Illegal entry in an array.

Stack trace

(C)\Data Dictionary\Tables\myTable\Methods\label - line 34


Microsoft.Dynamics.AX.ManagedInterop

   at Microsoft.Dynamics.AX.ManagedInterop.Record.CallWithReturnType(String methodName, Type returnType, Object[] paramList)
   at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsRecordAdapter.Call(String methodName, Object param1)

As of this writing, I have no idea what 'Illegal entry in an array' means.

Stay tuned...

UPDATE
Temporary Solution:
Well, I couldn't find a good solution for this. So here is the work around.
Original code throwing the error:

return mytable.myFieldArray[_arrayIndex];

Instead I do:

switch (_arrayIndex)
    {
        case 1:
            retValue = this.AttrFieldLabel[1];
            break;
        case 2:
            retValue = this.AttrFieldLabel[2];
            break;
        case 3:
            retValue = this.AttrFieldLabel[3];
            break;
        case 4:
            retValue = this.AttrFieldLabel[4];
            break;
    }

return retValue;

Hardcoding the index numbers on the array call seems to have solved my issue for now.

Happy coding!

Friday, December 15, 2017

SSRS Reports don't show labels

SSRS Reports aren't showing labels. Only Labels!@SYSxxxxx

This suddenly showed up after a code move.  It was preceded by an 'XppBridgeException' when running a single report (Print Invoice Journal).  There are a few posts out there with potential solutions such as checking your reporting service account password.  Our password never changes so there is no issue there.
I tried restarting the AOS.  Didn't work.  Cleared all cache.  Didn't work. Deployed all reports.  Didn't work.

Solution, hopefully, forthcoming...

Solution:

A Full CIL and reboot of our AOS servers and our SQL server has solved this problem.