This attribute map is invalid

Today I've been working on a nasty error which showed up during importing customizations. The error message was:

This attribute map is invalid. The selected attributes should be of the same type. The length of the source attribute and the formats should match. The targe attribute should not be used in another mapping."

To solve this error I have opened up the customizations.xml file and located the attribute maps ("ctrl + f" and search for AttributeMap). There were many custom build maps between exisiting entities. To find out which of these caused the error, I have removed them one by one until the error did not show up. That was the record that I needed to check and indeed that was the problem. The source entity did have this particular attribute set as a picklist and the destination entity had the type of the attribute set to bit. In the CRM system where I created the customizations file, both attributes were bits.

I hope this approach does help you solve the issue as well. Good luck!

8 comments:

Yenicca said...

I'm trying to import a new entity that hasn't been created, but came across this error as well. Any idea what's causing it?

Ronald Lemmen said...

Hi Yenicca,

Are you trying to import all entities or just new custom entity?

Ronald

yenicca said...

Hi Ronald,

Just the new custom entity. I've checked the sql database as well to make sure that it doesn't exist there, and it doesn't.

I then tried to create the new entity myself (just default, with no custom attributes & relationships), this worked fine.
But when I tried to import the customisation, I got the error that 'A record with these values already exists. A duplicate record cannot be created. Select one or more unique value and try again'.

It seems like there's something already in the database but I just can't see it.

Ronald Lemmen said...

Yenicca,

I used the database profiler to determine the record that was causing this issue. You can try to do that and find out what the last attribute is that it is trying to import. That might help.

Ronald

Nik said...

Even when you're on vacation, you're helping out :)
Getting this error doing deployment for you know who..

Cheers!

Anonymous said...

I had a similar problem, but I managed to overtake it by importing all customizations except account and contact entities(which caused the problem). Then I imported contact entity and finally account entity.

Kolyfan said...

I had similar problem with account_contacts relationship.
In my case proble was next:
When you create attribute in CRM - in correspondent SQL Table new field is created with length = MaxLengthCRMAttribute * 2
When you reduce MaxLength in CRM - length of correspondent SQL Table field stay without changes.
In my case someone "plays" with MaxLength in CRM and situation was next:
FirstName in Contact - MaxLength in CRM 50, Length in SQL = 100
FirstName in Account - MaxLength in CRM 50, Length in SQL = 200.
Then i increased MaxLength in CRM on FirstName in Contact to 100 and save changes (correspondent SQL field length become = 200); after that i decreased MaxLength in CRM on FirstName in Contact back to 50.
After that mapping can be created.

Arshad said...

Hi there,
It might be late. But I'm having the same problem. I deleted the AttributeMapping and the Opportunity entity gets imported successfully but it did not get published.
Also when I looked into the imported entity's attribute list, I cannot see the attributes (firstname, lastname, jobtitle) as well.
Any idea what's wrong