【问题标题】:Error in Saving of Regarding Attribute (Lead_PhoneCall Activity) from CRM Portal (2011)?从 CRM 门户 (2011) 保存有关属性(Lead_PhoneCall 活动)时出错?
【发布时间】:2015-01-16 22:36:12
【问题描述】:

我正在尝试保存有关电话活动领域的潜在客户指导, 它给出了一个错误,例如 - “关于objectid”。 [前提]

请帮忙!

在 New_PhoneCall.cs 页面中:

PhoneCall_Save.regardingobjectid = Guid.Parse(hdnfld_regarding.Value); //(hdnfld_regarding 是一个隐藏字段,其中 m 传递 guid,我已将其与文本框一起使用)

在 AppCode/CRMDMLibrary.cs 中:

    public class PhoneEntity
    {
       public Guid regardingobjectid;
    }

    public bool SaveNewPhoneCall()
    {
        try
        {
            IOrganizationService Context = CRMDMLibrary.GetCRMService(url, DomainName, username, password);

            Entity Phone = new Entity("phonecall");

            Phone["regardingobjectid"] = new EntityReference("regardingobject", regardingobjectid);

            Guid phoneid = Context.Create(Phone);
            return true;
        }
        catch (Exception ex)
        {
            HttpContext.Current.Response.Write(ex.Message);
            HttpContext.Current.Response.End();
            return false;
        }

    }

【问题讨论】:

    标签: c# asp.net dynamics-crm-2011 dynamics-crm crm


    【解决方案1】:

    将对象传递为 EntityReference 是错误的。您应该将 lead 传递为 实体参考

     Phone.Attributes["regardingobjectid"] = new EntityReference("lead", regardingobjectid);
    

    同时检查 lead id 的来源

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-08
      • 1970-01-01
      • 2023-04-04
      • 2011-08-03
      • 2014-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多