web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Create and use JSON object in Dynamics AX

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    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

  • YasirGodil Profile Picture
    204 on at

    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

  • Verified answer
    Community Member Profile Picture
    on at

    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 :)

  • Community Member Profile Picture
    on at

    Sorry Yasir - I will send you some private message.

    Good luck.

  • tlim Profile Picture
    on at

    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.

  • Jonathan  Halland Profile Picture
    11,310 on at

    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

  • tlim Profile Picture
    on at

    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.

  • CU13051429-0 Profile Picture
    351 on at

    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

  • tony.lim@junctionsolutions.com Profile Picture
    on at

    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.

  • Suggested answer
    Brian Kinser Profile Picture
    815 on at

    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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans