简体   繁体   English

如何在Microsoft Dynamics / CRM中使用C#/ SDK将帐户关联到联系人?

[英]How do I associate an account to a contact using C#/SDK in Microsoft Dynamics/CRM?

Hello. 你好。

I have sort of associated an account to a contact using C#/SDK. 我已经使用C#/ SDK将帐户与联系人相关联。 I used the parentcustomerid attribute on the contact entity. 我在联系人实体上使用了parentcustomerid属性。 If I go the CRM website (click this link ) and look up all the active contacts under my name, it is showing the acct under organization. 如果我去CRM网站(单击此链接 )并以我的名字查找所有活动联系人,则显示组织下的acct。 But when I click on the acct and want to view the details (click this link ), I cannot see any reference to the organization listed in the list. 但是,当我单击acct并想要查看详细信息(单击此链接 )时,我看不到对列表中所列组织的任何引用。

I also manually created a new contact using the Dynamics website (ie not SDK) and I can't find a way on entering a relationship. 我还使用Dynamics网站(即不是SDK)手动创建了一个新联系人,但找不到联系的方法。

Any ideas on how to do it via C# and via the website? 关于如何通过C#和网站进行操作的任何想法?

Thanks very much 非常感谢

for two entities to be linked to each other in CRM 2011. A field of type lookup is used to make relationship. 在CRM 2011中彼此链接的两个实体。类型lookup字段用于建立关系。

for example: 例如:

We want to associate account to contact . 我们想关联account进行contact So that each contact will be in an account. 这样每个联系人都会在一个帐户中。 or there will be a parent account of each contact . 否则每个contact都有一个parent account

So here are the steps in CRM 2011 Dynamics Website: 因此,这是CRM 2011 Dynamics网站中的步骤:

  1. Go the contact formeditor contact编队
  2. Click on New Field 点击New Field
  3. Select Lookup in Type 在类型中选择Lookup
  4. Target record type 'Account' 目标记录类型“帐户”
  5. Save and Close

Now Open any existing contact, you will find a new Lookup field on the contact, click and select any Account. 现在,打开任何现有联系人,您将在该联系人上找到一个新的Lookup字段,单击并选择任何客户。 A relationship will be created between them. 它们之间将建立关系。

In C# to create a new contact to be linked to account , below is the following code: In C#中创建要链接到account的新contact ,以下代码如下:

 Entity Contact_To_Be_Created = new Entity("contact");
 Contact_To_Be_Created.Attributes.Add("your_lookup_name",new EntityReference("account",GUID_of_the_account_you want to link));
 Service.create(Contact_To_Be_Created );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Dynamics CRM SDK搜索潜在客户或帐户? - How do I search for lead or account using Dynamics CRM SDK? 使用Dynamics CRM 2011 SDK和C#更新帐户 - Update Account using Dynamics CRM 2011 SDK and C# 如何使用C#删除Dynamics CRM中的帐户? - How to delete account in dynamics crm using c#? How to Create Case in Microsoft Dynamics CRM 2016 (Version 8) using webservices or REST API in JAVA or C#? - How to Create Case in Microsoft Dynamics CRM 2016 (Version 8) using webservices or REST API in JAVA or C#? 如果我不知道GUID,如何使用c#在Microsoft CRM上检索一条记录? - How do I retrieve a single record on Microsoft CRM using c# if I don't know the GUID? 在CRM C#中创建帐户的联系人绑定 - create contact bound of account in CRM C# Microsoft CRM Dynamics Online-如何检索活动列表并向其添加联系人 - Microsoft CRM Dynamics Online - How to retrieve a list of Campaigns and add a contact to it 未经授权的错误:使用C#查询或保存Dynamics CRM中的联系人/线索 - Unauthorized Error: Query or Save Contact/lead in Dynamics CRM Using C# 如何使用访问令牌将数据发布到C#中的Dynamics CRM中 - How to post data to Dynamics CRM in C# using Access Token 如何在Dynamics CRM中使用C#在CalendarRulesType属性中添加数据 - How to add data in CalendarRulesType attribute using c# in Dynamics CRM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM