Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在CRM标注中附加到表单上的字段?_C#_Dynamics Crm_Callouts_Dynamics Crm 3 - Fatal编程技术网

C# 如何在CRM标注中附加到表单上的字段?

C# 如何在CRM标注中附加到表单上的字段?,c#,dynamics-crm,callouts,dynamics-crm-3,C#,Dynamics Crm,Callouts,Dynamics Crm 3,我找不到这方面的任何信息。我有一个从表单激发的CRM调用,我需要附加到其中一个字段;例如,字段中可能有类似“BH”的内容,我需要调用来进行一些计算并更改字段,使其显示为“BH002129”或其他内容,但无论我如何尝试,它最终都会完全覆盖字段(因此在这种情况下,它只会显示“002129”)。我似乎无法将其附加,也无法理解如何读取该属性的值,以便将其固定到callout放在那里的字符串上。一定有办法做到这一点,对吗?但是怎么做呢 编辑:代码段: public override PreCallout

我找不到这方面的任何信息。我有一个从表单激发的CRM调用,我需要附加到其中一个字段;例如,字段中可能有类似“BH”的内容,我需要调用来进行一些计算并更改字段,使其显示为“BH002129”或其他内容,但无论我如何尝试,它最终都会完全覆盖字段(因此在这种情况下,它只会显示“002129”)。我似乎无法将其附加,也无法理解如何读取该属性的值,以便将其固定到callout放在那里的字符串上。一定有办法做到这一点,对吗?但是怎么做呢

编辑:代码段:


public override PreCalloutReturnValue PreCreate(CalloutUserContext userContext, CalloutEntityContext entityContext, ref string entityXml, ref string errorMessage)
  {
  // Variables
   string prefix = "no_init";

   XmlDocument entityDoc = new XmlDocument();
   entityDoc.LoadXml(entityXml);

   XmlNodeList propertyList = entityDoc.GetElementsByTagName("Property");
   XmlElement competitorNumberValue = null;
   XmlElement properties = (XmlElement) entityDoc.GetElementsByTagName("Properties")[0];
   XmlElement competitorNumberElement = entityDoc.CreateElement("Property");

   // Find prefix -- this is the part I don't know how to do
   prefix = Convert.ToString(?????);

           /*
               Other stuff gets calculated here, which works fine. New value gets written to the attribute here as well.
           */

   return PreCalloutReturnValue.Continue;   
  }
另一个编辑:我刚刚尝试了这个想法,我在网上找到了它,它实际上导致了CRM服务器在保存时出错:



            string nameSpaceValue = entityDoc.ChildNodes[0].Attributes["xmlns"].Value;
            XmlNamespaceManager xsn = new XmlNamespaceManager(entityDoc.NameTable);
            xsn.AddNamespace("z", nameSpaceValue);   
            string entityXpath = "//z:new_name";
            XmlNode new_nameNode = entityDoc.SelectSingleNode(entityXpath, xsn);

            // Find prefix
            prefix = ((XmlElement)new_nameNode).GetAttribute("new_name").ToString();

我认为您应该将其包装在一个动态实体中,以便可以直接访问每个属性


看看

我认为应该将其包装在动态实体中,以便可以直接访问每个属性


看一看

我使用这个类来处理callout实体xml

public abstract class EntityXmlParser
{
    public abstract bool isValueExists(params string[] arrParamName);
    public abstract string GetSingleValue(string sParamName, string sDefaultValue);
    public abstract int GetSingleValue(string sParamName, int nDefaultValue);
    public abstract decimal GetSingleValue(string sParamName, decimal nDefaultValue);
    public abstract Guid GetSingleValue(string sParamName, Guid idDefaultValue);
    public abstract DateTime GetSingleValue(string sParamName, DateTime dtDefaultValue);
}

public class EntityCrmCalloutXmlParser : EntityXmlParser
{
    private XmlDocument m_xmlDoc = null;
    private NameTable m_xmlNameTable = null;
    private XmlNamespaceManager m_xmlNameMgr = null;
    private const string ms_sURIXmlns = @"http://schemas.microsoft.com/crm/2006/WebServices";
    private const string ms_sURIXsi = @"http://www.w3.org/2001/XMLSchema-instance";
    private bool m_blChangeEntityXml = false;

public EntityCrmCalloutXmlParser(string sCalloutEntityXml)
{
    /*m_xd = new XPathDocument(new System.IO.StringReader(sCalloutEntityXml));
    m_xn = m_xd.CreateNavigator();*/
    m_xmlNameTable = new NameTable();
    m_xmlNameMgr = new XmlNamespaceManager(m_xmlNameTable);
    // Add the required prefix/namespace pairs to the namespace manager. Add a default namespace first.
    m_xmlNameMgr.AddNamespace("crm", ms_sURIXmlns);
    m_xmlNameMgr.AddNamespace("xsi", ms_sURIXsi);
    // загрузка xml-строки
    m_xmlDoc = new XmlDocument();
    m_xmlDoc.LoadXml(sCalloutEntityXml);
}

public string EntityXml
{
    get { return m_xmlDoc.OuterXml; }
}

public bool IsChangeEntityXml
{
    get { return m_blChangeEntityXml; }
}

public string GetEntityName()
{
    XmlNodeList xmllstItem = m_xmlDoc.SelectNodes("/crm:BusinessEntity/@Name", m_xmlNameMgr);
    if ((null == xmllstItem) || (1 != xmllstItem.Count))
        throw new CrmInternalException("Название сущности не найдено.");
    return xmllstItem[0].InnerText;
}

public override string GetSingleValue(string sParamName, string sDefaultValue)
{
    XmlNodeList xiter = m_xmlDoc.SelectNodes("//crm:Property[@Name='" + sParamName + "']/crm:Value", m_xmlNameMgr);
    if (0 == xiter.Count)
        return sDefaultValue;
    if ((1 != xiter.Count) /* || !xiter.MoveNext()*/)
        throw new System.ApplicationException("Ошибка при разборе входных значений. Неудалось однозначно определить параметр '" + sParamName + "'.");
    // проверка на значение null.
    XmlAttribute xmlIsNullAttribute = xiter.Item(0).Attributes["IsNull"];
    bool blNull = false;
    if (null != xmlIsNullAttribute)
        blNull = bool.Parse(xiter.Item(0).Attributes["IsNull"].Value);
    return (blNull) ? sDefaultValue : xiter.Item(0).InnerText;
}
public override Guid GetSingleValue(string sParamName, Guid idDefaultValue)
{
    return new Guid(GetSingleValue(sParamName, idDefaultValue.ToString("B")));
}

public override decimal GetSingleValue(string sParamName, decimal nDefaultValue)
{
    return decimal.Parse(GetSingleValue(sParamName, nDefaultValue.ToString(CalloutManager.Instance.NumberFormatInfo)), CalloutManager.Instance.NumberFormatInfo);
}

public override int GetSingleValue(string sParamName, int nDefaultValue)
{
    return int.Parse(GetSingleValue(sParamName, nDefaultValue.ToString()));
}

public override DateTime GetSingleValue(string sParamName, DateTime dtDefaultValue)
{
    return DateTime.Parse(GetSingleValue(sParamName, dtDefaultValue.ToString(CalloutManager.Instance.CRMFullDateFormat)));
}

    public bool SetPropertyValue(string sPropertyName, DateTime dtPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new ApplicationException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "CrmDateTimeProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        if (DateTime.MinValue.Equals(dtPropertyValue))
            xmlPropValueElem.SetAttribute("IsNull", string.Empty, "true");
        else
            xmlPropValueElem.InnerText = dtPropertyValue.ToString("s");

        m_blChangeEntityXml = true;
        return true;
    }


    public bool SetPropertyValue(string sPropertyName, string sPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new ApplicationException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "StringProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        xmlPropValueElem.InnerText = sPropertyValue;
        m_blChangeEntityXml = true;
        return true;
    }

    public bool SetPropertyValue(string sPropertyName, Guid idPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new CrmInternalException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "LookupProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        if (idPropertyValue.Equals(Guid.Empty))
            xmlPropValueElem.SetAttribute("IsNull", string.Empty, "true");
        else
            xmlPropValueElem.InnerText = idPropertyValue.ToString("B");
        m_blChangeEntityXml = true;
        return true;
    }

    public bool SetPropertyValue(string sPropertyName, int nPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new CrmInternalException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "CrmNumberProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        xmlPropValueElem.InnerText = nPropertyValue.ToString();
        m_blChangeEntityXml = true;
        return true;
    }

    public bool SetPropertyValue(string sPropertyName, decimal dPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new CrmInternalException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "CrmMoneyProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        xmlPropValueElem.InnerText = dPropertyValue.ToString(System.Globalization.CultureInfo.InvariantCulture);
        m_blChangeEntityXml = true;
        return true;
    }

}

}

我使用这个类与callout实体xml一起工作

public abstract class EntityXmlParser
{
    public abstract bool isValueExists(params string[] arrParamName);
    public abstract string GetSingleValue(string sParamName, string sDefaultValue);
    public abstract int GetSingleValue(string sParamName, int nDefaultValue);
    public abstract decimal GetSingleValue(string sParamName, decimal nDefaultValue);
    public abstract Guid GetSingleValue(string sParamName, Guid idDefaultValue);
    public abstract DateTime GetSingleValue(string sParamName, DateTime dtDefaultValue);
}

public class EntityCrmCalloutXmlParser : EntityXmlParser
{
    private XmlDocument m_xmlDoc = null;
    private NameTable m_xmlNameTable = null;
    private XmlNamespaceManager m_xmlNameMgr = null;
    private const string ms_sURIXmlns = @"http://schemas.microsoft.com/crm/2006/WebServices";
    private const string ms_sURIXsi = @"http://www.w3.org/2001/XMLSchema-instance";
    private bool m_blChangeEntityXml = false;

public EntityCrmCalloutXmlParser(string sCalloutEntityXml)
{
    /*m_xd = new XPathDocument(new System.IO.StringReader(sCalloutEntityXml));
    m_xn = m_xd.CreateNavigator();*/
    m_xmlNameTable = new NameTable();
    m_xmlNameMgr = new XmlNamespaceManager(m_xmlNameTable);
    // Add the required prefix/namespace pairs to the namespace manager. Add a default namespace first.
    m_xmlNameMgr.AddNamespace("crm", ms_sURIXmlns);
    m_xmlNameMgr.AddNamespace("xsi", ms_sURIXsi);
    // загрузка xml-строки
    m_xmlDoc = new XmlDocument();
    m_xmlDoc.LoadXml(sCalloutEntityXml);
}

public string EntityXml
{
    get { return m_xmlDoc.OuterXml; }
}

public bool IsChangeEntityXml
{
    get { return m_blChangeEntityXml; }
}

public string GetEntityName()
{
    XmlNodeList xmllstItem = m_xmlDoc.SelectNodes("/crm:BusinessEntity/@Name", m_xmlNameMgr);
    if ((null == xmllstItem) || (1 != xmllstItem.Count))
        throw new CrmInternalException("Название сущности не найдено.");
    return xmllstItem[0].InnerText;
}

public override string GetSingleValue(string sParamName, string sDefaultValue)
{
    XmlNodeList xiter = m_xmlDoc.SelectNodes("//crm:Property[@Name='" + sParamName + "']/crm:Value", m_xmlNameMgr);
    if (0 == xiter.Count)
        return sDefaultValue;
    if ((1 != xiter.Count) /* || !xiter.MoveNext()*/)
        throw new System.ApplicationException("Ошибка при разборе входных значений. Неудалось однозначно определить параметр '" + sParamName + "'.");
    // проверка на значение null.
    XmlAttribute xmlIsNullAttribute = xiter.Item(0).Attributes["IsNull"];
    bool blNull = false;
    if (null != xmlIsNullAttribute)
        blNull = bool.Parse(xiter.Item(0).Attributes["IsNull"].Value);
    return (blNull) ? sDefaultValue : xiter.Item(0).InnerText;
}
public override Guid GetSingleValue(string sParamName, Guid idDefaultValue)
{
    return new Guid(GetSingleValue(sParamName, idDefaultValue.ToString("B")));
}

public override decimal GetSingleValue(string sParamName, decimal nDefaultValue)
{
    return decimal.Parse(GetSingleValue(sParamName, nDefaultValue.ToString(CalloutManager.Instance.NumberFormatInfo)), CalloutManager.Instance.NumberFormatInfo);
}

public override int GetSingleValue(string sParamName, int nDefaultValue)
{
    return int.Parse(GetSingleValue(sParamName, nDefaultValue.ToString()));
}

public override DateTime GetSingleValue(string sParamName, DateTime dtDefaultValue)
{
    return DateTime.Parse(GetSingleValue(sParamName, dtDefaultValue.ToString(CalloutManager.Instance.CRMFullDateFormat)));
}

    public bool SetPropertyValue(string sPropertyName, DateTime dtPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new ApplicationException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "CrmDateTimeProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        if (DateTime.MinValue.Equals(dtPropertyValue))
            xmlPropValueElem.SetAttribute("IsNull", string.Empty, "true");
        else
            xmlPropValueElem.InnerText = dtPropertyValue.ToString("s");

        m_blChangeEntityXml = true;
        return true;
    }


    public bool SetPropertyValue(string sPropertyName, string sPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new ApplicationException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "StringProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        xmlPropValueElem.InnerText = sPropertyValue;
        m_blChangeEntityXml = true;
        return true;
    }

    public bool SetPropertyValue(string sPropertyName, Guid idPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new CrmInternalException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "LookupProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        if (idPropertyValue.Equals(Guid.Empty))
            xmlPropValueElem.SetAttribute("IsNull", string.Empty, "true");
        else
            xmlPropValueElem.InnerText = idPropertyValue.ToString("B");
        m_blChangeEntityXml = true;
        return true;
    }

    public bool SetPropertyValue(string sPropertyName, int nPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new CrmInternalException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "CrmNumberProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        xmlPropValueElem.InnerText = nPropertyValue.ToString();
        m_blChangeEntityXml = true;
        return true;
    }

    public bool SetPropertyValue(string sPropertyName, decimal dPropertyValue)
    {
        XmlNode xmlRootPropNode = m_xmlDoc.SelectSingleNode("crm:BusinessEntity/crm:Properties", m_xmlNameMgr);
        if (null == xmlRootPropNode)
            throw new CrmInternalException("Ошибка при получении xml элемента BusinessEntity.");
        // поиск элемента в xml-структуре
        XmlElement xmlPropValueElem = (XmlElement)xmlRootPropNode.SelectSingleNode("crm:Property[@Name='" + sPropertyName + @"']/crm:Value", m_xmlNameMgr);
        if (null == xmlPropValueElem)
        {   // элемент не найден
            // создание элемента
            XmlElement xmlPropElem = (XmlElement)xmlRootPropNode.AppendChild(m_xmlDoc.CreateElement("Property", ms_sURIXmlns));
            xmlPropElem.SetAttribute("type", ms_sURIXsi, "CrmMoneyProperty");
            xmlPropElem.SetAttribute("Name", sPropertyName);
            xmlPropValueElem = (XmlElement)xmlPropElem.AppendChild(m_xmlDoc.CreateElement("Value", ms_sURIXmlns));
        }
        xmlPropValueElem.InnerText = dPropertyValue.ToString(System.Globalization.CultureInfo.InvariantCulture);
        m_blChangeEntityXml = true;
        return true;
    }

}

}

你能发布你的代码吗?这是绝对可能的,但很难通过一个例子看出你可能做错了什么。我不知道我做错了什么,甚至不知道如何做,但我会在一秒钟内用适当的代码片段更新我的问题。你能发布你的代码吗?这是绝对可能的,但很难通过一个例子看出您可能做错了什么。我不知道我做错了什么,甚至不知道如何做,但我会在一秒钟内用适当的代码片段更新我的问题。