« Customer Effective’s Microsoft Dynamics CRM Expertise Delivers Business Expansion Opportunities for CAPTRUST | Main | Microsoft CRM Append Vs. Append Towhats the difference »

November 13, 2009

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e54fb34b6f883301287596d36a970c

Listed below are links to weblogs that reference Creating XML from a Dynamic Entity:

Comments

Vladislav

Maybe it's better to serialize it?

// for DynamicEntity
DynamicEntity dynamicEntity = GetSomeEntity();
XmlSerializer serializer = new XmlSerializer(typeof(DynamicEntity));
StringWriter stringWriter = new StringWriter();
serializer.Serialize(stringWriter, dynamicEntity);
stringWriter.ToString();


// for BusinessEntity
BusinessEntity сontact = GetSomeContact();
XmlSerializer serializer = new XmlSerializer(typeof(contact), "http://schemas.microsoft.com/crm/2007/WebServices");
MemoryStream stream = new MemoryStream();
serializer.Serialize(stream, сontact);
string s = UTF8Encoding.UTF8.GetString(stream.ToArray());

Will Wilson

I had thought about serializng it, but I wanted to take a more basic approach to give more flexibility to the resulting XML.

Also, in one of our integrations we've done, the actual XML elements were aliased - we translated the real CRM schema names to new names that had more meaning for the destination platform. This piece of code allowed us to quickly allow for that.

8gb usb drive

The DynamicEntity XML code that you create by using the Opportunity form differs from the DynamicEntity XML code that you create by using the Marketing List form in Microsoft Dynamics CRM 3.0. This problem occurs even though you use methods that are documented in the Microsoft Dynamics CRM Software Development Kit (SDK) to capture the DynamicEntity XML that is generated when an opportunity is created in Microsoft Dynamics CRM 3.0.

Web Developer, Machester

Nice idea. However, I dont think you can use extension method's with .Net 3.0 (The version of .Net that Crm is compiled under).

It will work well if you manage the server that Crm is installed on, but if it is someone else's server, you cant guarantee that .Net 3.5 will be installed and available.

All the same, Great Post.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.

Search The Blog

  • Search the Blog
     

    WWW
    this blog

Twitter Updates

    follow me on Twitter