I have a dataset in AOT with a simple display method "GetCatalogName" that queries SalesTable and returns some string value back.
In Visual Studio - User control, I have a AxGridView with a bunch of fields. I am using above display method from a data source for one of the bound field to show Catalog name in the grid. When I test the control in EP site, it errors out with following exception.
Dynamics Object Adapter Call failed.
Specified argument was out of the range of valid values.
Parameter name: index
System.ArgumentOutOfRangeException
at Microsoft.Dynamics.AX.Framework.Portal.Data.DataSetView.GetElement(Int32 index)
at Microsoft.Dynamics.AX.Framework.Portal.Data.DataSetView.GetCurrent(Boolean forceKernelFetch)
at Microsoft.Dynamics.AX.Framework.Portal.Data.DataSetView.FormDataSource_CacheChanged(Object sender, Object args)
at Microsoft.Dynamics.AX.ManagedInterop.ClrBridgeImpl.ExecuteHandler(ClrBridgeImpl* , ObjectWrapper* pObjectWrapperHandler, ObjectWrapper* pObjectWrapperSender, ObjectWrapper* pObjectWrapperEventArgs)
at interpret.{ctor}(interpret* )
at AxEventDelegate.kcInvoke(AxEventDelegate* , interpret* ip)
at cqlClass.callEx(cqlClass* , Char* , interpret* )
at AxCore.AxRuntime.Call(AxRuntime* , IAxObject* axObject, String methodName, Type returnType, Object& result, Object[] paramList)
at Microsoft.Dynamics.AX.ManagedInterop.Object.CallWithReturnType(String methodName, Type returnType, Object[] paramList)
at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsObjectAdapter.Call(String methodName, Object param1)
When I changed display method to return "hard code" string, user control shows rest of the fields, I mean it does not throw error.
Has anyone encountered this issue ? Any solution or help would be appreciated.