locked
Customer entity not available in 2011 RRS feed

  • Question

  • I have an entity called Customer which is used in a CRM 4 plugin which I want to convert to 2011. I generated a .cs file with crmsvcutil.exe for the entities but I cannot find the Customer entity.

    In the CRM 4 plugin, when I click on Customer and Go To Definition, Visual studio opens a Reference.cs file and this is what I get:

    /// <remarks/>
     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.4927")]
     [System.SerializableAttribute()]
     [System.Diagnostics.DebuggerStepThroughAttribute()]
     [System.ComponentModel.DesignerCategoryAttribute("code")]
     [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/crm/2006/WebServices")]
     public partial class Customer : CrmReference {
     }
    

    I think that if I can make a file like this for CRM 2011 and put it in my project I can solve my problem of not being able to use the Customer entity in CRM 2011 plugin. Does anyone have an idea how this can be done?
    Monday, August 8, 2011 8:05 PM

Answers

  • Customer class is kind of pseudo entity that could represent either a contact or account record. In CRM 2011, you should be using EntityReference class for the same purpose.
    Daniel Cai | http://danielcai.blogspot.com
    • Marked as answer by KatRiketa Monday, August 8, 2011 9:59 PM
    Monday, August 8, 2011 9:53 PM

All replies

  • If you create a custom entity called Customer, the schema name of the entity won't be called Customer, it should be new_customer or yourprefix_customer, depending on what customization prefix you used when you created the entity.


    Daniel Cai | http://danielcai.blogspot.com
    Monday, August 8, 2011 8:17 PM
  • My custom entities are all with the fg_ prefix but there isn't any fg_Customer or Customer entities. Is there a Customer entity in CRM 2011 or 4?
    Monday, August 8, 2011 8:37 PM
  • Yes, Customer is a special pseudo entity in CRM.

    It's strange that you cannot find fg_customer entity if you are sure that is the entity name. Do you happen to have multiple organizations on the same CRM server, and you run CrmSvcUtil against an organization that has not been customized?

    If that's not the case, can you show us the command line parameters that you used for CrmSvcUtil?


    Daniel Cai | http://danielcai.blogspot.com

    Monday, August 8, 2011 8:42 PM
  • This code is used in CRM 4: new Customer();

    I don't know if this means that there is a entity of this type in the DB or there is some other place where entities are defined.

    I cannot do that in CRM 2011.

    These are the parameters from the crmsvcutil:

    crmsvcutil.exe /url:http://{server}/{organization}/XRMServices/2011/Organization.svc /out:Generated.cs /username:user /password:pass


    And I am sure that there is only one organization.
    Monday, August 8, 2011 9:37 PM
  • Can you check what schema name is used for Customer entity in both CRM 4, and CRM2011?

    I really doubt that you can use Customer class for your custom entity, since any custom entity should have a prefix.


    Daniel Cai | http://danielcai.blogspot.com
    Monday, August 8, 2011 9:41 PM
  • Someone else wrote the code for the CRM 4 plugin, but I think that the Customer class is not a custom class. I can't find it in the DB.
    Monday, August 8, 2011 9:44 PM
  • Customer class is kind of pseudo entity that could represent either a contact or account record. In CRM 2011, you should be using EntityReference class for the same purpose.
    Daniel Cai | http://danielcai.blogspot.com
    • Marked as answer by KatRiketa Monday, August 8, 2011 9:59 PM
    Monday, August 8, 2011 9:53 PM
  • Thanks. After your post, from the code I saw that instead of Customer I can use Account.

    Monday, August 8, 2011 10:00 PM