Monday, January 6, 2014

Missing Attribute Labels when Importing CRM 4.0 Customisations

So here I am preparing a release for our QA team to test. It's a pretty simple release, just a few entities to go into a big QA system for load testing. Imagine my surprise when 4 of the 5 entities import, and one consistently throws up unhelpful CRM errors. Here's what I can find in the Event Log on the CRM server:

"Customization Import failed. Error: Attribute Display Name not specified"

To cut a long story short - I had several attributes on my entity that were unpublished - a rookie mistake! So make sure you publish your entity before exporting it. Why this happens, I don't know - all I know at this point was that before re-publishing the entity customisations my attribute looked like this:

<attribute PhysicalName="my_attributename">
    <Type>datetime</Type>
    <ValidForCreateApi>1</ValidForCreateApi>
    <ValidForUpdateApi>1</ValidForUpdateApi>
    <ValidForReadApi>1</ValidForReadApi>
    <IsCustomField>1</IsCustomField>
    <AttributeTypeId>00000000-0000-0000-00aa-110000000015</AttributeTypeId>
    <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid</DisplayMask>
    <ImeMode>auto</ImeMode>
    <RequiredLevel>none</RequiredLevel>
    <Format>date</Format>
</attribute>

After publishing becomes:

<attribute PhysicalName="my_attributename">
    <Type>datetime</Type>
    <ValidForCreateApi>1</ValidForCreateApi>
    <ValidForUpdateApi>1</ValidForUpdateApi>
    <ValidForReadApi>1</ValidForReadApi>
    <IsCustomField>1</IsCustomField>
    <AttributeTypeId>00000000-0000-0000-00aa-110000000015</AttributeTypeId>
    <DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid</DisplayMask>
    <Descriptions>
        <Description description="Attribute Name" languagecode="1033" />
    </Descriptions>
    <ImeMode>auto</ImeMode>
    <RequiredLevel>none</RequiredLevel>
    <Format>date</Format>
    <displaynames>
      <displayname description="Attribute Name" languagecode="1033" />
    </displaynames>
</attribute>

No comments:

Post a Comment