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
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
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
52
Victor Onyebuchi
6