次の方法で共有


"Invalid Argument" Error reported while importing a customization.

 

Multiple customers encountered recently a situation where they could not import a customization file due to an “Invalid Argument” failure.

If the entity to be imported was “Contact” then the returned message would be:

"Either the file could not be uploaded or Import failed.

Additional Messages:

Failure: contact: Invalid Argument.”

 

If CRM tracing was enabled then the following entry can be found in the corresponding log file:

[2009-01-01 10:10:10.0] Process: w3wp |Organization:xxxxxxxxx-0000-0000-0000-xxxxxxxxxxx|Thread:    1 |Category: Exception |User: xxxxxxx-0000-0000-0000-xxxxxxxxxxx|Level: Error |  at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException, Boolean enableTrace)
at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException)
at CrmException..ctor(String message, Int32 errorCode)
at LocalizedLabelHelper.ValidateLabelContent(Label label, String parameterName)
at LocalizedLabelHelper.ValidateLabelCollectionContents(LabelCollection labelCollection, String parameterName)
at AttributeService.ValidateForUpdate(AttributeInfo attributeInfo, MetadataBusinessEntity existingAttributeData, ExecutionContext context)

Crm Exception: Message: Attribute Display Name is null or empty, ErrorCode: –2147220989

 

This is now a precise pointer  to the part of the customization file is causing the validation error.

Opening the customization file in an editor will indeed show an empty “Display Name”:

<attribute PhysicalName="Salutation">
...
   <displaynames>
      <displayname description="Salutation" languagecode="1033" />
      <displayname description="" languagecode="1031" />
   </displaynames>
...

</attribute>

The immediate solution is to enter a string in the “displayname” description attribute, save the file and retry the import. You may need to repeat these steps if multiple attributes are empty.

 

How do you get into such a situation?

Typically the customizers will export the labels for translation and while editing the worksheet they can clear entries for labels for languages other than then base languages. This will not invalidate the translation file so the translation import will work without any problems.

The problem will surface only when exporting the entity customization and attempting importing it in another configuration.