locked
CRM 2011 - Atributes Name, SchemaName and DisplayName RRS feed

  • Question

  • Hi All,

    I have question regarding attributes name in CRM 2011.

    In CRM 4.0 if we go the Customisation area for any entity and click on "Attributes" we see result in a grid which shows  'name'(which is schema name) , 'Display name' and 'Type'  but

    in CRM 2011 there are ' name', 'Schema name' and 'Display name' columns. I thought 'name' and 'schema name' should be the same. Can someone explain this to me. What's the

    difference between 'Name' and 'Schema name' column. Please see below images for clear understanding.

     

     

     


    Thank you all for your help - CRM Thirsty
    Sunday, August 14, 2011 11:36 PM

Answers

  • From the CRM 2011 SDK:

    Entity Names

    There are two types of names, and both must have a customization prefix:

    • EntityMetadata.LogicalName: Name that is the version of the entity name that is set in all lowercase letters.
    • EntityMetadata.SchemaName: Name that will be used to create the database tables for the entity. This name can be mixed case. The casing that you use sets the name of the object generated for programming with strong types or when you use the REST endpoint.
    Note
    If the logical name differs from the schema name, the schema name will override the value that you set for the logical name.

     

    When an entity is created in the application in the context of a specific solution, the customization prefix used is the one set for the Publisher of the solution. When an entity is created programmatically, you can set the customization prefix to a string that is between two and eight characters in length, all alphanumeric characters and it must start with a letter. It cannot start with ‘mscrm’. The best practice is to use the customization prefix defined by the publisher that the solution is associated with, but this is not a requirement. An underscore character must be included between the customization prefix and the logical or schema name.

    Name in both the CRM 4.0 and 2011 screenshots refer to the Logical Name (all lowercase).  The Schema Name exists in CRM 4.0 also; you just can't see it in the GUI.

     


    --pogo (pat) @ pogo69.wordpress.com
    • Marked as answer by CRM Thirsty Monday, August 15, 2011 1:38 AM
    Monday, August 15, 2011 12:54 AM
  • You always use schema name for programming purpose.
    Thank you all for your help - CRM Thirsty

    This is inaccurate.  For the purposes of the Xrm.Page (2011) and crmForm (4.0) javascript object model, you use the logical attribute names (all lower case).

    The schema name is used for early bound classes (LINQ) but you don't have to worry about that given that you benefit from intellisense; schema names are also used for the new REST/oData/JSON object model.


    --pogo (pat) @ pogo69.wordpress.com
    • Proposed as answer by CMerc Thursday, August 18, 2011 11:57 AM
    • Marked as answer by CRM Thirsty Friday, August 19, 2011 12:58 AM
    Wednesday, August 17, 2011 10:32 PM

All replies

  • From the CRM 2011 SDK:

    Entity Names

    There are two types of names, and both must have a customization prefix:

    • EntityMetadata.LogicalName: Name that is the version of the entity name that is set in all lowercase letters.
    • EntityMetadata.SchemaName: Name that will be used to create the database tables for the entity. This name can be mixed case. The casing that you use sets the name of the object generated for programming with strong types or when you use the REST endpoint.
    Note
    If the logical name differs from the schema name, the schema name will override the value that you set for the logical name.

     

    When an entity is created in the application in the context of a specific solution, the customization prefix used is the one set for the Publisher of the solution. When an entity is created programmatically, you can set the customization prefix to a string that is between two and eight characters in length, all alphanumeric characters and it must start with a letter. It cannot start with ‘mscrm’. The best practice is to use the customization prefix defined by the publisher that the solution is associated with, but this is not a requirement. An underscore character must be included between the customization prefix and the logical or schema name.

    Name in both the CRM 4.0 and 2011 screenshots refer to the Logical Name (all lowercase).  The Schema Name exists in CRM 4.0 also; you just can't see it in the GUI.

     


    --pogo (pat) @ pogo69.wordpress.com
    • Marked as answer by CRM Thirsty Monday, August 15, 2011 1:38 AM
    Monday, August 15, 2011 12:54 AM
  • So the part that's confusing to me is, which is used when using the Xrm.Page object? 

    And are different ones used for Xrm.Page.ui.controls[...] versus Xrm.Page.data.entity.attributes(....)?  and what about the CRM.Form.All...???

    I named my attribute names similarly throughout before I encountered this confusion.


    Louis
    Wednesday, August 17, 2011 7:58 PM
  • You always use schema name for programming purpose.
    Thank you all for your help - CRM Thirsty
    • Proposed as answer by CMerc Thursday, August 18, 2011 11:57 AM
    • Unproposed as answer by CMerc Thursday, August 18, 2011 11:57 AM
    Wednesday, August 17, 2011 10:11 PM
  • You always use schema name for programming purpose.
    Thank you all for your help - CRM Thirsty

    This is inaccurate.  For the purposes of the Xrm.Page (2011) and crmForm (4.0) javascript object model, you use the logical attribute names (all lower case).

    The schema name is used for early bound classes (LINQ) but you don't have to worry about that given that you benefit from intellisense; schema names are also used for the new REST/oData/JSON object model.


    --pogo (pat) @ pogo69.wordpress.com
    • Proposed as answer by CMerc Thursday, August 18, 2011 11:57 AM
    • Marked as answer by CRM Thirsty Friday, August 19, 2011 12:58 AM
    Wednesday, August 17, 2011 10:32 PM
  • So to clarify for myself;

    the Name column in the Fields view is the Logical Attribute names

     

    Name  is used in Xrm.Page...get...(...) including Xrm.Page.ui.controls...get...(...) 

    Schema names are used in .Net and REST/oData/JSON references

     

    And just to be complete;

    Display name is the default used only in forms and views

    Xrm.Page.ui.controls.get uses whatever you typed to generate controls from WebResources.

     

    Thanks for the clarification.


    Louis
    Thursday, August 18, 2011 11:57 AM
  • Thanks Pat for correcting me.
    Thank you all for your help - CRM Thirsty
    Friday, August 19, 2011 12:54 AM
  • this all really is a bit of a mess...

    i've just finished a stack of REST framework stuff where everything is so case sensitive...now writing a plugin and have to go all lowercase...

     

     

    Friday, December 2, 2011 8:18 AM
  • Hello Crm Thirsty,

    Actually they are the same except that the name is the the schema name name but converted into lower case , and when using the attribute

    names through plugins or web services or late bound queries  you should use the name not the schema name .

    if you use the the schema name (which maybe contains upper case letters) in a plugin for example, it will throw an exception that the entity

    you are targeting has no field with this name .
    Friday, January 18, 2013 6:30 PM