locked
CRM 2011 RRS feed

  • Question

  • Hello All,

    Can we override CRM internal primary field means i have one scenario as follows.

    We are using CRM 2011, in this CRM in Lead form there are First Name and Last Name fields. We removed that fields from the form and we mapped Lead to Contact by Company Name.

    In this case when we create one lead that time first name and last name are blank and in advance search Lead information means company name are not coming.

    So my challenge is that is there any way to override Lead entity primary field from FullName to Company name.

    Waiting for your valuable reply and thanks in advance.

    Abhijeet Katigar

    Tuesday, February 18, 2014 6:44 AM

All replies

  • You can have a Pre Create/Update plugin to override the "fullname" attribute in the TargetEntity with the value from "companyname"

    Here's the sample plugin for Contact. You can reference and update it accordingly for lead entity.

    Set custom Full Name format in CRM 2011 with Plugin

    • Edited by Linn Zaw Win Tuesday, February 18, 2014 7:12 AM Adding Sample Code
    Tuesday, February 18, 2014 6:58 AM
  • Hi Linn

    I gone through your solution but i just want to ask you, there is one field name as "Company Name"  and i want the flow, when i create lead that time value which in company name have to set to field "Fullname".

    Can we achieve this in CRM.Waiting for your valuable answers and thanks in advance.

    Abhijeet Katigar

    Tuesday, February 18, 2014 10:06 AM
  • Yes,

    Just as in this example, your Pre Create/Update plugin should set the value of "fullname" attribute in the TargetEntity with the value from "companyname"

    if (target.Contains("companyname"))
    {
       target["fullname"] = target.GetAttributeValue<string>("companyname");
    }

    Tuesday, February 18, 2014 10:13 AM
  • Hi Abhijeet,

    You may not be able to directly update the fullname but you can try updating the last name with the company name and that will handle the updation of the fullname.

    Thanks


    If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful" Thank you, DT

    Tuesday, February 18, 2014 10:37 AM
  • I tried updating the fullname in the pre plugin.

    It's working.

    Tuesday, February 18, 2014 10:53 AM