
Dear experts,
I am using RetailCommonWebAPI::getMapFromJsonString(_json) code to read JSON string from AIF custom service. I am getting the below error
System.InvalidCastException: Object must implement IConvertible.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Dynamics.Ax.Application.RetailCommonWebAPI.getMap(Object _dict) in RetailCommonWebAPI.getMap.xpp:line 11
at Dynamics.Ax.Application.RetailCommonWebAPI.getMapFromJsonString(String _jsonString) in RetailCommonWebAPI.getMapFromJsonString.xpp:line 25
at Dynamics.Ax.Application.JSONIntegrationUpdate.Deserializejson(String _jsonString) in JSONIntegrationUpdate.deserializeJson.xpp:line 27
Above method is working fine when we call from job or something. Getting error on CIL only. How to resolve this issue? or any other standard code there to read JSON string (deserialize ) in x++.
Thanks in advance.
I suggest you debug the code to see what exactly happens at line 11 of getMap(). When you know the cause, you'll be in a much better position to find a solution.