Announcements
No record found.
Hello,
Is there any object of JSON, I can use in Dynamics AX (2009).
Need example doing that, please.
Thanks :)
*This post is locked for comments
JSON is a language-independent data format, and code for parsing and generating JSON data is readily available in a large variety of programming languages.
As per my understanding it is available in Dynamics AX X++
but you can utilize Visual Studio to create a COM object and reference that in AX 2009 to utilize the JSON capability
If you need further help how to implement this, please let me know more details about your requirement and will try to help you further
Hi Eitan,
Were you able to use JSON in AX2009. I know we have NewtonSoft DLLs that we can use to parse the JSON data in AX. However, I am looking for some native solution. Were you able to find any?
Yasir
That's was long time ago I opened this thread.
There were many things work not properly for this dlls (I have checked that), because json presume being binary, while there is try to set it as string (and like C#, it has some extra characters for specials .... such as // - json shall add /unnnn for special characters.
There are lot of problems, not mentioned, and since I need also pure "REST" for json (not that encapsulated by some xml), I did parsing myself, by supporting query+datacontract (for ax 2012), but I don't think I deal with json for ax 2009.
This is closed issue.
Thanks, anyway :)
Sorry Yasir - I will send you some private message.
Good luck.
Hi Eitan, I was trying to use RetailCommonWebAPI to deserialize json but getting "Must implement IConvertible" error. So now, I'm looking at alternatives. Can you share how you developed your own JSON deserializer? Thanks.
Tlim
What was the structure of the JSON that you were trying to return? Was there any binary or other strange data types in it? The RetailCommonWebAPI is customisable so you could for certain elements choose to not deserialise them
My json string is pretty simple {"CompanyId":"001","TransactionType":"100","Ranch":"200004","ItemId":"000000005","Qty":"2"}. What I found was that it is crashing at this statement:
deserializedCollection = new System.Collections.Hashtable(_dict);
in getMap Method with this error:
get_InnerException 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.drscl_JSONStagi
It worked fine when running it in the AOT Job but it is crashing when running IT in the batch or calling it from a WCF Custom Service.
Hi Tlim,
I am also facing same error in batch mode in side RetailCommonWebAPI call.
in non-batch mode, it works fine..
during batch mode processing got above mentioned error.
gave CLRobject assert permission too. yet same error during batch mode.
how did you resolved your issue. kindly share .
Thanks
Neetu
Hi Neetu,
I believed someone in my organization wrote their own version to de-serialize the Josn string. I wasn't involve with that process. Sorry I couldn't be much help.
I deserialize using the RetailCommonWebAPI .....but I check for value in each conpeek before trying to use it.....I noticed in the client that it just showed blank while the batch mode it failed.....not sure why
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Joris dG 5
Alexey Lekanov 2
Henrik Nordlöf 2 User Group Leader