Skip to main content

Notifications

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

  • Community Member Profile Picture
    on at
    RE: XML child Elements

    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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans