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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to properly serialize/deserialize an entity (late binding)?

(0) ShareShare
ReportReport
Posted on by 135

Here's the scoop.

I'm developing a web site for a client that uses CRM 2011 (on premises) as a data source. I'm using late binding.

Since I cannot have live connection during my testing (I can only access CRM via RDP) I came with an idea of mocking CRM data during development stage by exporting the relevant entities into files and then use said files locally.

Exporting data and serializing them into JSON via JavaScriptSerializer was a piece of cake. 

However, for the life of my I cannot figure out how to deserialize them back. The singular properties (LoficalName, Id, etc) work just fine, but the AttributeCollection and FormattedValues serialize as arrays of objects and cannot be brought back as collections. I'm not even talking about the fact that attributes can have different structure depending on type.

So, in short, my question is: how would you serialize a late bound entity so it's deserializeable back? JSON is preferable, but if XML is the only way, I'd take that , too...

TIA!

Nikolai

*This post is locked for comments

I have the same question (0)
  • Satish Tiwari - CRM Profile Picture
    on at

    Hi Nikolai,

    You can also serialize and deserialize late bound entity with help of SDK. You can refer to blogs for more information.

    msdn.microsoft.com/.../hh675409

    msdn.microsoft.com/.../gg309272.aspx

    Post here, if it helps you.

    Regards,

    Satish T

  • DarthSLR Profile Picture
    135 on at

    Satish, thank you!

    You can rest assure I looked at that example. Unfortunately, SDK only allows you to deserialize the early-bound entity (and to XML only). As I have mentioned, I'm using late-bound and JSON.

    I ended up writing a custom code based on JavaScriptSerializer and custom helper classes.

    Thanks again.

    Nikolai

  • Satish Tiwari - CRM Profile Picture
    on at

    Nikolai, Thanks for sharing information with me !

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans