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 CRM (Archived)

XML child Elements

(0) ShareShare
ReportReport
Posted on by

I'm trying to add and element before a child but not having much look. I think it's something obvious but i'm seeming nothing. What i'm trying to get and i have cut down to only the relevant information is. I have asked before and i'm now trying to delete that question because it was a bit confusing

<lv_ordertype>Order</lv_ordertype>
<references>
<WebReference>
<reference_index>7</reference_index>
<reference_value>ST</reference_value>
<WebReference>
</references>
<customer />
<delivery>

but what i'm getting is

<lv_ordertype>Order</lv_ordertype>
<references>
<reference_index>7</reference_index>
<reference_value>ST</reference_value>
</references>
<customer />
<delivery>

My code looks like this for this section

[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class WebSalesOrderreferences
 {
    private string reference_indexField;
    private string reference_valueField;
  //  [XmlArray("WebReferences")]
    private string reference_7Field;
    private string reference_8Field;
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public string reference_index
    {
        get
        {
            return this.reference_indexField;
        }
        set
        {
            this.reference_indexField = value;
        }
    }
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public string reference_value
    {
        get
        {
            return this.reference_valueField;
        }
        set
        {
            this.reference_valueField = value;
        }
    }
}

I thought it would be as simple as putting an xmlarray but that didn't work. Just for information this is pushing from Mircosoft CRM to our Accounts system

Kind Regards

Dan

*This post is locked for comments

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

    Hi

    I have finally work out where is was going wrong and resolved the issue. This has now created a new issue . I have multiple values for the same elements as such i would trying to do something like below but not sure i'm correct in my thinking

        WebSalesOrderreferences[] websalesorderreferences = new WebSalesOrderreferences[1];

               websalesorderreferences[0] = new WebSalesOrderreferences();

              // websalesorder.references = websalesorderreferences;

              websalesorderreferences[0].reference_index ="7";

               websalesorderreferences[0].reference_value = "ST";

               websalesorderreferences[1] = new WebSalesOrderreferences();

                 websalesorderreferences[1].reference_index = "8";

                websalesorderreferences[1].reference_value = "test";

               websalesorder.references = websalesorderreferences;

    Any advice

    Kind Regards

    Dan

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans