zoukankan      html  css  js  c++  java
  • Associate——关联两条记录

    1,如果一个实体的FORM中包含另下个实体类型的字段,直接将关联的实体的字段指向被关联实体的EntityReference就OK了
    2,如果一个实体与另一个实体FORM中都没有包含相应的字段,而只是出现在左侧的导航中,则应调用AssociateEntitiesRequest将两者关联起来
    AssociateRequest teamToProfile = new AssociateRequest
    {
        Target = new EntityReference(FieldSecurityProfile.EntityLogicalName, _profileId),
        RelatedEntities = new EntityReferenceCollection
        {
            new EntityReference(Team.EntityLogicalName, _teamId)
        },
        Relationship = new Relationship("teamprofiles_association")
    };
    
    // Execute the request.
    _serviceProxy.Execute(teamToProfile);
    
    3,还有一类是系统定义好的关系实体,如商机产品,报价单产品,订单产品等,这种的只需要在创建的时候给相应的opportunityid,quoteid等字段赋好值,则会自动建立关联,如果没给这些字段,会则报错“The parent id is missing”
  • 相关阅读:
    个人附加作业
    个人最终总结
    结对作业--电梯调度
    VS2015安装&简单的C#单元测试
    C#程序代码分析(第三周)
    HTML学习有感
    gitlab使用有感之坚持
    学习有感

    Activity总结
  • 原文地址:https://www.cnblogs.com/liaochifei/p/2762589.html
Copyright © 2011-2022 走看看