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)

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

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